import { StrictMode, useState } from "react"; import { createRoot } from "react-dom/client"; import type { IPlatformService } from "@zcode/shared"; import { ZCodeIntlProvider } from "@/i18n/IntlProvider.js"; import { PlatformProvider } from "@/hooks/usePlatform.js"; import { AddMarketplaceSourceDialog } from "@/settings/AddMarketplaceSourceDialog.js"; import "@/styles.css"; const params = new URLSearchParams(location.search); document.documentElement.className = params.get("theme") === "light" ? "light theme-zai-light" : "dark theme-zai-dark"; const platform = { canSelectFilePath: params.get("platform") === "desktop", selectDirectory: async () => "/fixture/marketplace", getPathForFile: (file: File) => `/fixture/${file.name}`, } as IPlatformService; function Fixture() { const [open, setOpen] = useState(false); const [error, setError] = useState(null); const [activeOperations, setActiveOperations] = useState>([]); return (
{ setActiveOperations([{ id: `marketplace:add:${source}` }]); try { const response = await fetch("/add-marketplace", { method: "POST", body: source }); if (!response.ok) { setError("Fixture: source unavailable"); return false; } return true; } finally { setActiveOperations([]); } }} />
); } createRoot(document.getElementById("root")!).render( , );