New and improved buttons for the history

This commit is contained in:
sageTheDM 2024-10-09 13:27:35 +02:00
parent c5f7469f0f
commit 363a7d2fc3
2 changed files with 57 additions and 14 deletions

View file

@ -34,28 +34,35 @@ const History: React.FC = () => {
{/* Populate with history items */}
{chatHistory.chats.map((chats, index) => (
<li key={index}>
<a href="#" onClick={() => handleHistoryClick(index)}>{chatHistory.chats[index].name}</a>
<a href="#" onClick={() => handleHistoryClick(index)}>
{chatHistory.chats[index].name}
</a>
</li>
))}
<li>
{isEditing ? (
<div>
<input
type="text"
value={inputValue}
onChange={handleInputChange}
placeholder="Enter text"
/>
<button onClick={handleSaveButtonClick}>Save</button>
</div>
) : (
<button onClick={handleEditButtonClick}>{'New Chat'}</button>
)}
<div className="input-container">
<input
type="text"
value={inputValue}
onChange={handleInputChange}
placeholder="Enter text"
className="chat-input"
/>
<button onClick={handleSaveButtonClick} className="save-btn">
Save
</button>
</div>
) : (
<button onClick={handleEditButtonClick} className="newChat-btn">
New Chat
</button>
)}
</li>
</ul>
</div>
</div>
);
);
};
export default History;