- Add debounced state updates for title and content (500ms delay) - Immediate UI updates with delayed history saving - Prevent one-letter-per-undo issue - Add cleanup for debounce timers on unmount
24 lines
587 B
TypeScript
24 lines
587 B
TypeScript
import { getNotes, searchNotes } from '@/app/actions/notes'
|
|
import { NoteInput } from '@/components/note-input'
|
|
import { NoteGrid } from '@/components/note-grid'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export default async function HomePage({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<{ search?: string }>
|
|
}) {
|
|
const params = await searchParams
|
|
const notes = params.search
|
|
? await searchNotes(params.search)
|
|
: await getNotes()
|
|
|
|
return (
|
|
<main className="container mx-auto px-4 py-8 max-w-7xl">
|
|
<NoteInput />
|
|
<NoteGrid notes={notes} />
|
|
</main>
|
|
)
|
|
}
|