import React, { useState } from 'react'; 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 (
); }; export default History;