import { format } from 'date-fns'; import type { EntrySeen, EpisodeSeen } from '@/types'; import { Button } from '@/components/ui/button'; import { Pencil, Trash2 } from 'lucide-react'; interface EpisodeWatchHistoryProps { watchHistory: (EntrySeen | EpisodeSeen)[]; onEdit?: (id: number) => void; onDelete?: (id: number) => void; } export function EpisodeWatchHistory({ watchHistory, onEdit, onDelete, }: EpisodeWatchHistoryProps) { if (watchHistory.length === 0) { return (

No watch history yet.

); } return (

Watch History

{watchHistory.map((record) => ( ))}
Date Seen With Actions
{record.date_seen ? format(new Date(record.date_seen), 'MMM d, yyyy') : '-'} {record.seen_with || '-'}
{onEdit && ( )} {onDelete && ( )}
); }