import { Calendar, Tag, FileText, AlertCircle, CheckCircle2, Circle } from 'lucide-react' import Link from 'next/link' interface ItemDetailProps { item: { id: string title: string description: string | null completed: boolean priority: string dueDate: Date | null tags: any notes: string | null createdAt: Date updatedAt: Date listId: string } listTitle: string } export default function ItemDetail({ item, listTitle }: ItemDetailProps) { const tags = Array.isArray(item.tags) ? item.tags : [] const isOverdue = item.dueDate && new Date(item.dueDate) < new Date() && !item.completed const priorityColors = { low: 'bg-green-100 text-green-800', medium: 'bg-yellow-100 text-yellow-800', high: 'bg-red-100 text-red-800', } const priorityColor = priorityColors[item.priority as keyof typeof priorityColors] || priorityColors.medium return (
Completed
)}{new Date(item.dueDate).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', })}
{isOverdue && (Overdue
)}No due date
)}{item.description}
{item.notes}
Created: {new Date(item.createdAt).toLocaleString('en-US', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', })}
Updated: {new Date(item.updatedAt).toLocaleString('en-US', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', })}