import { Image } from 'antd'; import React, { useState } from 'react'; import { IChatItem } from '../ChatLogsType'; import styles from './index.module.scss'; export const ChatImage: React.FC = (props) => { const [visible, setVisible] = useState(false); function content() { try { const msg = JSON.parse(props.chat?.content as string); return (
{ setVisible(value); }, }} src={`/api/${msg.path}`} style={{ maxWidth: '100%', maxHeight: '100%', objectFit: 'contain' }} alt="" />
); } catch (_e) { return (
{props.chat?.content}
); } } return <>{content()}; };