@esvndev/es-react-template-chat 0.0.99 → 0.0.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -72282,7 +72282,7 @@ const ChatLog = (props) => {
72282
72282
  const [isOpen, setIsOpen] = useState(false);
72283
72283
  const [openModalPreview, setOpenModalPreview] = useState(false);
72284
72284
  useState(false);
72285
- useState(false);
72285
+ const [openModalReminder, setOpenModalReminder] = useState(false);
72286
72286
  useState(false);
72287
72287
  useState('');
72288
72288
  useState(null);
@@ -72860,70 +72860,50 @@ const ChatLog = (props) => {
72860
72860
  fontWeight: 500
72861
72861
  }, children: moment(chat.time).format("HH:mm") })] }));
72862
72862
  }, []);
72863
- // const renderChatReminder = useCallback((chat: any) => {
72864
- // let msgContent = chat.msg
72865
- // let timeDisplay = chat.time
72866
- // try {
72867
- // const parsed = JSON.parse(chat.msg)
72868
- // if (parsed && typeof parsed === 'object') {
72869
- // msgContent = parsed.content || chat.msg
72870
- // timeDisplay = parsed.scheduleTime || chat.time
72871
- // }
72872
- // } catch (e) {
72873
- // // Not JSON, use original
72874
- // }
72875
- // return (
72876
- // <div
72877
- // style={{
72878
- // borderTopRightRadius: 6,
72879
- // borderBottomRightRadius: 6,
72880
- // // borderTopLeftRadius: 6, // Should be conditional or default
72881
- // borderBottomLeftRadius: 6,
72882
- // backgroundColor: '#fff',
72883
- // padding: '20px 20px 15px 20px',
72884
- // boxShadow: '0 4px 24px 0 rgba(34, 41, 47, 0.1)',
72885
- // minWidth: 300,
72886
- // textAlign: 'center',
72887
- // marginBottom: 15
72888
- // }}
72889
- // >
72890
- // <div style={{ marginBottom: 8, display: 'flex', justifyContent: 'center' }}>
72891
- // <Clock color="#ea5455" fontSize={32} />
72892
- // </div>
72893
- // <div style={{ fontWeight: 600, fontSize: 16, marginBottom: 4, color: '#5e5873' }}>
72894
- // {msgContent}
72895
- // </div>
72896
- // <div style={{ color: '#6e6b7b', fontSize: 12, marginBottom: 16, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
72897
- // <Clock fontSize={12} style={{ marginRight: 4 }} />
72898
- // {moment(timeDisplay).calendar(null, {
72899
- // lastDay: '[Hôm qua lúc] HH:mm',
72900
- // sameDay: '[Hôm nay lúc] HH:mm',
72901
- // nextDay: '[Ngày mai lúc] HH:mm',
72902
- // lastWeek: 'dddd [lúc] HH:mm',
72903
- // nextWeek: 'dddd [lúc] HH:mm',
72904
- // sameElse: 'DD/MM/YYYY HH:mm'
72905
- // })}
72906
- // </div>
72907
- // <div
72908
- // style={{
72909
- // border: '1px solid #00cfe8',
72910
- // color: '#00cfe8',
72911
- // padding: '8px',
72912
- // borderRadius: 4,
72913
- // cursor: 'pointer',
72914
- // fontWeight: 600,
72915
- // fontSize: 14,
72916
- // width: '100%'
72917
- // }}
72918
- // onClick={() => {
72919
- // setOpenModalReminder(true)
72920
- // }}
72921
- // >
72922
- // Xem chi tiết
72923
- // </div>
72924
- // </div>
72925
- // )
72926
- // }, [])
72863
+ useCallback((chat) => {
72864
+ let msgContent = chat.msg;
72865
+ let timeDisplay = chat.time;
72866
+ try {
72867
+ const parsed = JSON.parse(chat.msg);
72868
+ if (parsed && typeof parsed === 'object') {
72869
+ msgContent = parsed.content || chat.msg;
72870
+ timeDisplay = parsed.scheduleTime || chat.time;
72871
+ }
72872
+ }
72873
+ catch (e) {
72874
+ // Not JSON, use original
72875
+ }
72876
+ return (jsxs("div", { style: {
72877
+ borderTopRightRadius: 6,
72878
+ borderBottomRightRadius: 6,
72879
+ // borderTopLeftRadius: 6, // Should be conditional or default
72880
+ borderBottomLeftRadius: 6,
72881
+ backgroundColor: '#fff',
72882
+ padding: '20px 20px 15px 20px',
72883
+ boxShadow: '0 4px 24px 0 rgba(34, 41, 47, 0.1)',
72884
+ minWidth: 300,
72885
+ textAlign: 'center',
72886
+ marginBottom: 15
72887
+ }, children: [jsx("div", { style: { marginBottom: 8, display: 'flex', justifyContent: 'center' }, children: jsx(SvgClock, { color: "#ea5455", fontSize: 32 }) }), jsx("div", { style: { fontWeight: 600, fontSize: 16, marginBottom: 4, color: '#5e5873' }, children: msgContent }), jsxs("div", { style: { color: '#6e6b7b', fontSize: 12, marginBottom: 16, display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: [jsx(SvgClock, { fontSize: 12, style: { marginRight: 4 } }), moment(timeDisplay).calendar(null, {
72888
+ lastDay: '[Hôm qua lúc] HH:mm',
72889
+ sameDay: '[Hôm nay lúc] HH:mm',
72890
+ nextDay: '[Ngày mai lúc] HH:mm',
72891
+ lastWeek: 'dddd [lúc] HH:mm',
72892
+ nextWeek: 'dddd [lúc] HH:mm',
72893
+ sameElse: 'DD/MM/YYYY HH:mm'
72894
+ })] }), jsx("div", { style: {
72895
+ border: '1px solid #00cfe8',
72896
+ color: '#00cfe8',
72897
+ padding: '8px',
72898
+ borderRadius: 4,
72899
+ cursor: 'pointer',
72900
+ fontWeight: 600,
72901
+ fontSize: 14,
72902
+ width: '100%'
72903
+ }, onClick: () => {
72904
+ setOpenModalReminder(true);
72905
+ }, children: "Xem chi ti\u1EBFt" })] }));
72906
+ }, []);
72927
72907
  // const renderMessageReply = useCallback((type: IArchiveType, msg?: string, path?: any[]) => {
72928
72908
  // switch (type) {
72929
72909
  // case "file": // ✅ THÊM CASE NÀY