interstellar_ai/app/components/History.tsx

31 lines
722 B
TypeScript
Raw Normal View History

2024-10-07 16:41:31 +02:00
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)
}
2024-09-18 10:03:36 +02:00
return (
<div className="history-background">
<div className="history">
<ul>
2024-09-18 11:17:34 +02:00
{/* Populate with history items */}
{Array.from({ length: 20 }, (_, index) => (
<li key={index}>
2024-10-07 16:41:31 +02:00
<a href="#" onClick={()=>handleHistoryClick(index)}>history{index + 1}</a>
2024-09-18 11:17:34 +02:00
</li>
))}
</ul>
2024-09-18 10:03:36 +02:00
</div>
</div>
);
};
export default History;