Files
bodyshop/client/src/components/chat-open-button/chat-open-button.component.jsx

17 lines
584 B
JavaScript

import { MessageFilled } from "@ant-design/icons";
import React from "react";
import { connect } from "react-redux";
import { openChatByPhone } from "../../redux/messaging/messaging.actions";
const mapDispatchToProps = (dispatch) => ({
openChatByPhone: (phone) => dispatch(openChatByPhone(phone)),
});
export function ChatOpenButton({ phone, jobid, openChatByPhone }) {
return (
<MessageFilled
style={{ margin: 4 }}
onClick={() => openChatByPhone({ phone_num: phone, jobid: jobid })}
/>
);
}
export default connect(null, mapDispatchToProps)(ChatOpenButton);