20 lines
633 B
JavaScript
20 lines
633 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={(e) => {
|
|
e.stopPropagation();
|
|
openChatByPhone({ phone_num: phone, jobid: jobid });
|
|
}}
|
|
/>
|
|
);
|
|
}
|
|
export default connect(null, mapDispatchToProps)(ChatOpenButton);
|