fix: eslint format

This commit is contained in:
jialin
2024-05-16 10:45:45 +08:00
parent fd9f3d8bd9
commit dcaa5a7baa
13 changed files with 359 additions and 186 deletions
+28 -24
View File
@@ -1,31 +1,33 @@
import { Button,Space,Tooltip} from "antd";
import { EditOutlined, CopyOutlined,DislikeOutlined,SyncOutlined} from '@ant-design/icons';
import ChatEmpty from "./chatEmpty";
import chatStyle from './chat-style.less'
import avatar from '@/assets/images/avatar.png'
import logo from '@/assets/images/logo.png'
import avatar from '@/assets/images/avatar.png';
import logo from '@/assets/images/logo.png';
import { CopyOutlined, DislikeOutlined, EditOutlined, SyncOutlined } from '@ant-design/icons';
import { Button, Space, Tooltip } from 'antd';
import chatStyle from './chat-style.less';
import ChatEmpty from './chatEmpty';
export type ChatContentProps = {
messageList: any[];
}
};
const QuestionMessage:React.FC<{content: string;}> = ({content}) => {
const QuestionMessage: React.FC<{ content: string }> = ({ content }) => {
return (
<div className={chatStyle.chatMessageItem}>
<span className={chatStyle.img}>
<img src={avatar} alt="" />
</span>
<span className={chatStyle.name}>YOU</span>
<div className={chatStyle.contentWrap}>
<span className={chatStyle.edit}><Button type="text" size="middle" icon={<EditOutlined />}></Button></span>
<span className={chatStyle.edit}>
<Button type="text" size="middle" icon={<EditOutlined />}></Button>
</span>
<p className={chatStyle.content}>{content}</p>
</div>
</div>
)
}
);
};
const AnswerMessage:React.FC<{content: string;}> = ({content}) => {
const AnswerMessage: React.FC<{ content: string }> = ({ content }) => {
return (
<div className={chatStyle.chatMessageItem}>
<span className={chatStyle.img}>
@@ -37,7 +39,7 @@ const AnswerMessage:React.FC<{content: string;}> = ({content}) => {
<Tooltip title="复制">
<Button type="text" size="middle" icon={<CopyOutlined />}></Button>
</Tooltip>
<Tooltip title="复制">
<Tooltip title="刷新">
<Button type="text" size="middle" icon={<SyncOutlined />}></Button>
</Tooltip>
<Tooltip title="回答错误">
@@ -45,17 +47,19 @@ const AnswerMessage:React.FC<{content: string;}> = ({content}) => {
</Tooltip>
</Space>
</div>
)
}
);
};
const ChatContent:React.FC<ChatContentProps> = ({ messageList }) => {
const ChatContent: React.FC<ChatContentProps> = ({ messageList }) => {
if (messageList.length === 0) {
return <ChatEmpty/>
return <ChatEmpty />;
}
return (<div className={chatStyle.chatContent}>
<QuestionMessage content="hello"></QuestionMessage>
<AnswerMessage content="hello, nice to meet you!"></AnswerMessage>
</div>)
}
return (
<div className={chatStyle.chatContent}>
<QuestionMessage content="hello"></QuestionMessage>
<AnswerMessage content="hello, nice to meet you!"></AnswerMessage>
</div>
);
};
export default ChatContent;
export default ChatContent;