"use client"; import useStore from "@/lib/store"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Clock, Trash2, RotateCcw } from "lucide-react"; import { translations } from "@/lib/i18n/translations"; export default function HistoryPanel() { const { language, history, setCurrentPrompt, clearHistory } = useStore(); const t = translations[language].history; const common = translations[language].common; const handleRestore = (prompt: string) => { setCurrentPrompt(prompt); }; const handleClear = () => { if (confirm(t.confirmClear)) { clearHistory(); } }; if (history.length === 0) { return (

{t.empty}

{t.emptyDesc}

); } return (
{t.title} {history.length} {t.items}
{history.map((item) => (
{new Date(item.timestamp).toLocaleString()}

{item.prompt}

))}
); }