Components / cms-trash
Trash
Deleted documents and files: restore them, or delete them forever (admins). Shown when `createCms({ trash })` keeps deleted things, which is the default (30 days).
With the shadcn CLI
npx shadcn add https://agent-cms-docs.vercel.app/r/cms-trash.jsonWith the agent-cms CLI
npx @mainsoft/agent-cms add cms-trashLive demoRuns on a demo database that resets every 30 minutes.
Trash
Loading…
Usage#
// app/admin/trash/page.tsx
"use client";
import { CmsTrash } from "@/components/cms/cms-trash";
export default function TrashPage() {
return <CmsTrash />;
}The sidebar shows "Trash" with its count to whoever may edit. Restoring a document that was published makes it public again. Deleting for good and "Empty trash" are for admins. How long things stay is createCms({ trash: { days } }); see Publishing flow.
note
On npm from 0.10.0. The demo is shared by every visitor and starts over every 30 minutes.