@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.js CHANGED
@@ -72319,7 +72319,7 @@ const ChatLog = (props) => {
72319
72319
  const [isOpen, setIsOpen] = React.useState(false);
72320
72320
  const [openModalPreview, setOpenModalPreview] = React.useState(false);
72321
72321
  React.useState(false);
72322
- React.useState(false);
72322
+ const [openModalReminder, setOpenModalReminder] = React.useState(false);
72323
72323
  React.useState(false);
72324
72324
  React.useState('');
72325
72325
  React.useState(null);
@@ -72897,70 +72897,50 @@ const ChatLog = (props) => {
72897
72897
  fontWeight: 500
72898
72898
  }, children: moment(chat.time).format("HH:mm") })] }));
72899
72899
  }, []);
72900
- // const renderChatReminder = useCallback((chat: any) => {
72901
- // let msgContent = chat.msg
72902
- // let timeDisplay = chat.time
72903
- // try {
72904
- // const parsed = JSON.parse(chat.msg)
72905
- // if (parsed && typeof parsed === 'object') {
72906
- // msgContent = parsed.content || chat.msg
72907
- // timeDisplay = parsed.scheduleTime || chat.time
72908
- // }
72909
- // } catch (e) {
72910
- // // Not JSON, use original
72911
- // }
72912
- // return (
72913
- // <div
72914
- // style={{
72915
- // borderTopRightRadius: 6,
72916
- // borderBottomRightRadius: 6,
72917
- // // borderTopLeftRadius: 6, // Should be conditional or default
72918
- // borderBottomLeftRadius: 6,
72919
- // backgroundColor: '#fff',
72920
- // padding: '20px 20px 15px 20px',
72921
- // boxShadow: '0 4px 24px 0 rgba(34, 41, 47, 0.1)',
72922
- // minWidth: 300,
72923
- // textAlign: 'center',
72924
- // marginBottom: 15
72925
- // }}
72926
- // >
72927
- // <div style={{ marginBottom: 8, display: 'flex', justifyContent: 'center' }}>
72928
- // <Clock color="#ea5455" fontSize={32} />
72929
- // </div>
72930
- // <div style={{ fontWeight: 600, fontSize: 16, marginBottom: 4, color: '#5e5873' }}>
72931
- // {msgContent}
72932
- // </div>
72933
- // <div style={{ color: '#6e6b7b', fontSize: 12, marginBottom: 16, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
72934
- // <Clock fontSize={12} style={{ marginRight: 4 }} />
72935
- // {moment(timeDisplay).calendar(null, {
72936
- // lastDay: '[Hôm qua lúc] HH:mm',
72937
- // sameDay: '[Hôm nay lúc] HH:mm',
72938
- // nextDay: '[Ngày mai lúc] HH:mm',
72939
- // lastWeek: 'dddd [lúc] HH:mm',
72940
- // nextWeek: 'dddd [lúc] HH:mm',
72941
- // sameElse: 'DD/MM/YYYY HH:mm'
72942
- // })}
72943
- // </div>
72944
- // <div
72945
- // style={{
72946
- // border: '1px solid #00cfe8',
72947
- // color: '#00cfe8',
72948
- // padding: '8px',
72949
- // borderRadius: 4,
72950
- // cursor: 'pointer',
72951
- // fontWeight: 600,
72952
- // fontSize: 14,
72953
- // width: '100%'
72954
- // }}
72955
- // onClick={() => {
72956
- // setOpenModalReminder(true)
72957
- // }}
72958
- // >
72959
- // Xem chi tiết
72960
- // </div>
72961
- // </div>
72962
- // )
72963
- // }, [])
72900
+ React.useCallback((chat) => {
72901
+ let msgContent = chat.msg;
72902
+ let timeDisplay = chat.time;
72903
+ try {
72904
+ const parsed = JSON.parse(chat.msg);
72905
+ if (parsed && typeof parsed === 'object') {
72906
+ msgContent = parsed.content || chat.msg;
72907
+ timeDisplay = parsed.scheduleTime || chat.time;
72908
+ }
72909
+ }
72910
+ catch (e) {
72911
+ // Not JSON, use original
72912
+ }
72913
+ return (jsxRuntime.jsxs("div", { style: {
72914
+ borderTopRightRadius: 6,
72915
+ borderBottomRightRadius: 6,
72916
+ // borderTopLeftRadius: 6, // Should be conditional or default
72917
+ borderBottomLeftRadius: 6,
72918
+ backgroundColor: '#fff',
72919
+ padding: '20px 20px 15px 20px',
72920
+ boxShadow: '0 4px 24px 0 rgba(34, 41, 47, 0.1)',
72921
+ minWidth: 300,
72922
+ textAlign: 'center',
72923
+ marginBottom: 15
72924
+ }, children: [jsxRuntime.jsx("div", { style: { marginBottom: 8, display: 'flex', justifyContent: 'center' }, children: jsxRuntime.jsx(SvgClock, { color: "#ea5455", fontSize: 32 }) }), jsxRuntime.jsx("div", { style: { fontWeight: 600, fontSize: 16, marginBottom: 4, color: '#5e5873' }, children: msgContent }), jsxRuntime.jsxs("div", { style: { color: '#6e6b7b', fontSize: 12, marginBottom: 16, display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: [jsxRuntime.jsx(SvgClock, { fontSize: 12, style: { marginRight: 4 } }), moment(timeDisplay).calendar(null, {
72925
+ lastDay: '[Hôm qua lúc] HH:mm',
72926
+ sameDay: '[Hôm nay lúc] HH:mm',
72927
+ nextDay: '[Ngày mai lúc] HH:mm',
72928
+ lastWeek: 'dddd [lúc] HH:mm',
72929
+ nextWeek: 'dddd [lúc] HH:mm',
72930
+ sameElse: 'DD/MM/YYYY HH:mm'
72931
+ })] }), jsxRuntime.jsx("div", { style: {
72932
+ border: '1px solid #00cfe8',
72933
+ color: '#00cfe8',
72934
+ padding: '8px',
72935
+ borderRadius: 4,
72936
+ cursor: 'pointer',
72937
+ fontWeight: 600,
72938
+ fontSize: 14,
72939
+ width: '100%'
72940
+ }, onClick: () => {
72941
+ setOpenModalReminder(true);
72942
+ }, children: "Xem chi ti\u1EBFt" })] }));
72943
+ }, []);
72964
72944
  // const renderMessageReply = useCallback((type: IArchiveType, msg?: string, path?: any[]) => {
72965
72945
  // switch (type) {
72966
72946
  // case "file": // ✅ THÊM CASE NÀY