import { getTrashedNotes } from '@/app/actions/notes'
import { MasonryGrid } from '@/components/masonry-grid'
import { TrashHeader } from '@/components/trash-header'
import { TrashEmptyState } from './trash-empty-state'

export const dynamic = 'force-dynamic'

export default async function TrashPage() {
  const notes = await getTrashedNotes()

  return (
    <main className="container mx-auto px-4 py-8 max-w-7xl">
      <TrashHeader noteCount={notes.length} />
      {notes.length > 0 ? (
        <MasonryGrid notes={notes} isTrashView />
      ) : (
        <TrashEmptyState />
      )}
    </main>
  )
}
