import { getTranslations } from "next-intl/server"; import { Layout } from "lucide-react"; import { createBox, deleteBox, toggleBox, updateBox } from "@/actions/admin-writeable-boxes"; import { StatusCard } from "@/components/admin/dashboard"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; export const metadata = { title: "Writeable boxes" }; export default async function AdminWriteableBoxes() { const t = await getTranslations("pages.admin.writeableBoxes"); const boxes = await prisma.websiteWriteableBoxes .findMany({ orderBy: [{ position: "asc" }, { id: "asc" }], take: 500, }) .catch(() => []); const activeCount = boxes.filter((b) => b.isActive).length; return (

{t("title")}

{t("subtitle")}

0 ? "ok" : "neutral"} hint={t("shownOnHomePage")} icon="✅" />

{t("newBox")}