feat: user settings

This commit is contained in:
jialin
2024-05-30 09:26:09 +08:00
parent a99b58fbb4
commit 69f354b278
14 changed files with 382 additions and 22 deletions
@@ -4,6 +4,7 @@ import '../style/ground-left.less';
import ChatFooter from './chat-footer';
import MessageItem from './message-item';
import ReferenceParams from './reference-params';
import ViewCodeModal from './view-code-modal';
const MessageList: React.FC = () => {
const [messageList, setMessageList] = useState<any[]>([
@@ -16,6 +17,7 @@ const MessageList: React.FC = () => {
message: 'hello, nice to meet you!'
}
]);
const [show, setShow] = useState(false);
const [activeIndex, setActiveIndex] = useState(-1);
const handleNewMessage = () => {
@@ -33,13 +35,17 @@ const MessageList: React.FC = () => {
};
const handleView = () => {
console.log('view');
setShow(true);
};
const handleSubmit = () => {
console.log('submit');
};
const handleCloseViewCode = () => {
setShow(false);
};
const handleDelete = (index: number) => {
messageList.splice(index, 1);
setMessageList([...messageList]);
@@ -71,6 +77,11 @@ const MessageList: React.FC = () => {
feedback={<ReferenceParams></ReferenceParams>}
></ChatFooter>
</div>
<ViewCodeModal
open={show}
onCancel={handleCloseViewCode}
title="View code"
></ViewCodeModal>
</div>
);
};