import { getApi } from "@/bknd"; import { revalidatePath } from "next/cache"; import { Fragment } from "react"; import { List } from "@/components/List"; export default async function Home() { // without "{ verify: true }", this page can be static const api = await getApi(); const limit = 5; const todos = await api.data.readMany("todos", { limit, sort: "-id" }); const total = todos.body.meta.total; return ( <>

What's next?

{total > limit && (
{total - limit} more todo(s) hidden
)}
{todos.reverse().map((todo) => (
{ "use server"; const api = await getApi(); await api.data.updateOne("todos", todo.id, { done: !todo.done, }); revalidatePath("/"); }} />
{todo.title}
))}
t.id).join()} action={async (formData: FormData) => { "use server"; const title = formData.get("title") as string; const api = await getApi(); await api.data.createOne("todos", { title }); revalidatePath("/"); }} >
); } const Description = () => ( );