import { getListWithItems } from '@/lib/actions' import { notFound } from 'next/navigation' import Link from 'next/link' import { ArrowLeft, Plus } from 'lucide-react' import ItemCard from '@/components/ItemCard' import InlineItemCreate from '@/components/InlineItemCreate' export default async function ListDetailPage({ params }: { params: { id: string } }) { const list = await getListWithItems(params.id) if (!list) { notFound() } const completedItems = list.items.filter(item => item.completed) const incompleteItems = list.items.filter(item => !item.completed) return (
{/* Header */}
Back to Lists

{list.title}

{completedItems.length} of {list.items.length} tasks completed

{/* Inline Item Creation */}
{/* Items List */}
{/* Incomplete Items */} {incompleteItems.length > 0 && (

To Do ({incompleteItems.length})

{incompleteItems.map((item) => ( ))}
)} {/* Completed Items */} {completedItems.length > 0 && (

Completed ({completedItems.length})

{completedItems.map((item) => ( ))}
)} {/* Empty State */} {list.items.length === 0 && (

No tasks yet

Add your first task to get started

)}
) }