start chatHistory
This commit is contained in:
parent
a60cc7e941
commit
76da6aed0e
8 changed files with 89 additions and 38 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue