import { ArrowLeft } from 'lucide-react' import { useEffect, useState } from 'react' import { Button } from '@/components/ui/button' import { type SessionRecord, getSession } from '@/lib/db' import { EventCard } from './cards' export function HistoryDetail({ sessionId, onBack }: { sessionId: string; onBack: () => void }) { const [session, setSession] = useState(null) useEffect(() => { getSession(sessionId).then((s) => setSession(s ?? null)) }, [sessionId]) if (!session) { return (
Loading...
) } return (
{/* Header */}
History
{/* Task */}
Task
{session.task}
{/* Events (read-only) */}
{session.history.map((event, index) => ( // eslint-disable-next-line react-x/no-array-index-key ))}
) }