start chatHistory

This commit is contained in:
YasinOnm08 2024-10-07 16:41:31 +02:00
parent a60cc7e941
commit 76da6aed0e
8 changed files with 89 additions and 38 deletions

View file

@ -1,6 +1,16 @@
import React from 'react';
import React, { useState } from 'react';
interface HistoryProps{
selectedIndex: number;
setSelectedIndex: (index: number) => void;
}
const History: React.FC<HistoryProps> = ({selectedIndex, setSelectedIndex}) => {
const handleHistoryClick = (index: number) => {
setSelectedIndex(index)
}
const History: React.FC = () => {
return (
<div className="history-background">
<div className="history">
@ -8,7 +18,7 @@ const History: React.FC = () => {
{/* Populate with history items */}
{Array.from({ length: 20 }, (_, index) => (
<li key={index}>
<a href="#">history{index + 1}</a>
<a href="#" onClick={()=>handleHistoryClick(index)}>history{index + 1}</a>
</li>
))}
</ul>