import { NextIntlClientProvider } from "next-intl"; import { useState } from "react"; import { createRoot } from "react-dom/client"; import { Toaster } from "sonner"; import { EventForm } from "@/app/admin/events/event-form"; import { CmsSettingsForm } from "@/app/admin/settings/cms-settings-form"; import { TicketsTable } from "@/app/admin/tickets/tickets-table"; import { ArticleForm } from "@/components/admin/article-form"; import { FurnitureSyncQueue } from "@/components/admin/studio/furniture-sync-queue"; import type { ArticleSaveResult } from "@/lib/article-input"; import { themePaletteCss } from "@/lib/theme-css"; import { PRESETS } from "@/lib/theme-presets"; import messages from "@/messages/en.json"; import { AttachmentHarness } from "./attachment-harness"; import { FurnitureJobsHarness } from "./furniture-jobs-harness"; import { fixtureAction } from "./server-actions"; const theme = document.createElement("style"); theme.textContent = themePaletteCss( ":root.dark", PRESETS["Atom (golden)"].dark, ); document.head.appendChild(theme); const route = window.location.pathname; const root = document.getElementById("root"); if (!root) throw Error("Fixture root missing"); const rows = [ { id: 1, subject: "Account assistance", creator: "SampleMember", creatorId: 7, category: "general", messages: 2, status: "open", priority: "normal", assignee: "Moderator", date: "01/01/2030", awaitingStaff: true, replyAgeMinutes: 90, }, { id: 2, subject: "Event question", creator: "AnotherMember", creatorId: 8, category: "events", messages: 1, status: "waiting", priority: "high", assignee: "—", date: "01/01/2030", awaitingStaff: false, replyAgeMinutes: 15, }, ]; const saveArticle = async (form: FormData): Promise => fixtureAction("article", Object.fromEntries(form)); function ArticleFixture() { const [visible, setVisible] = useState(true); return ( <> {route.includes("recovery") && ( )} {visible && ( Join the upcoming event and explore the hotel together.

", status: "draft", }} /> )} ); } createRoot(root).render(

{route.includes("settings") ? "CMS settings" : route.includes("tickets") ? "Support desk" : route.includes("articles") ? "News editor" : "Furniture synchronization"}

{route.includes("attachment-harness") ? ( ) : route.includes("events/recovery") ? ( ) : route.includes("jobs-harness") ? ( ) : route.includes("settings") ? ( ) : route.includes("tickets") ? ( ) : route.includes("articles") ? ( ) : ( )}
, );