Files
scrm.antd/src/pages/ChatLogs/components/ChatLocation.tsx

30 lines
899 B
TypeScript
Raw Normal View History

2023-04-11 15:29:40 +08:00
import { EnvironmentFilled } from '@ant-design/icons';
import { IChatItem } from '../ChatLogsType';
export const ChatLocation: React.FC<IChatItem> = (props) => {
function content() {
try {
const msg = JSON.parse(props.chat?.content as string);
return (
2023-04-13 17:36:49 +08:00
<div style={{ display: 'flex', color: '#000' }}>
<EnvironmentFilled style={{ fontSize: 40, color: '#FA9D3B', flexShrink: 0 }} />
<div style={{ wordBreak: 'break-all', paddingLeft: 12 }}>
2023-04-11 15:29:40 +08:00
<div>{msg.title}</div>
<div>{msg.address}</div>
</div>
2023-04-13 17:36:49 +08:00
</div>
2023-04-11 15:29:40 +08:00
);
} catch (_e) {
return (
<div>
<EnvironmentFilled style={{ fontSize: 40, color: '#FA9D3B', flexShrink: 0 }} />
2023-04-13 17:36:49 +08:00
<div style={{ wordBreak: 'break-all', paddingLeft: 12 }}>{props.chat?.content}</div>
2023-04-11 15:29:40 +08:00
</div>
);
}
}
2023-04-13 17:36:49 +08:00
return <>{content()}</>;
2023-04-11 15:29:40 +08:00
};