diff --git a/app/components/History.tsx b/app/components/History.tsx index e4d593a..297e638 100644 --- a/app/components/History.tsx +++ b/app/components/History.tsx @@ -3,30 +3,11 @@ import { useChatHistory } from '../hooks/useChatHistory'; const History: React.FC = () => { const [chatHistory, setChatHistory, setSelectedIndex] = useChatHistory() - const [isEditing, setIsEditing] = useState(false); - const [inputValue, setInputValue] = useState(''); - - const handleEditButtonClick = () => { - setIsEditing(true); - }; - - const handleInputChange = (e: React.ChangeEvent) => { - setInputValue(e.target.value); - }; - - const handleSaveButtonClick = () => { - setIsEditing(false); - chatHistory.chats.push({ name: inputValue, messages: [], timestamp: 5 }) - setInputValue("") - }; const handleHistoryClick = (index: number) => { setSelectedIndex(index) - console.log("index",index); - } - return (
@@ -37,21 +18,6 @@ const History: React.FC = () => { handleHistoryClick(index)}>{chatHistory.chats[index].name} ))} -
  • - {isEditing ? ( -
    - - -
    - ) : ( - - )} -
  • diff --git a/app/hooks/useChatHistory.tsx b/app/hooks/useChatHistory.tsx index e3c550c..b849d79 100644 --- a/app/hooks/useChatHistory.tsx +++ b/app/hooks/useChatHistory.tsx @@ -19,8 +19,7 @@ interface GlobalChatHistory { let globalChatHistory: GlobalChatHistory = { chats: [ - { name: "Chat 1", messages: [{role:"system",content:"you are a helpful assistant"},{role:"assistant",content:"how can i help you"}], timestamp: 4 }, - { name: "Chat 2", messages: [{role:"system",content:"you are a helpful assistant"},{role:"assistant",content:"how can i help you"}], timestamp: 4 }, + { name: "Chat 1", messages: [], timestamp: 4 } ], selectedIndex:0 }