import { useState } from "react"; import { createRoot } from "react-dom/client"; import { ConnectorCard } from "../../src/components/ConnectorCard"; import { PluginsPanel } from "../../src/components/PluginsPanel"; import { StoreProvider, useStore, type Message } from "../../src/state/store"; import { setAnalyticsEnabled } from "../../src/lib/analytics"; import { applySkin, readSkin } from "../../src/lib/skins"; import "../../src/styles.css"; // Only the disposable OAuth recipe serves this entry; production components // stay mounted, while these controls simulate a server card update/deletion. function Preview() { const { state, dispatch } = useStore(); const [target, setTarget] = useState(1); const [status, setStatus] = useState<"required" | "authorizing" | "failed">("required"); const [error, setError] = useState(); const [showCard, setShowCard] = useState(true); const message: Message = { id: `connector-${target}`, role: "bot", kind: "connector", at: 1, connector: { slug: "gmail", label: "Gmail", description: "Synthetic mail account", status, resumeKey: "fixture", ...(error ? { error } : {}) }, }; return
{showCard && } {state.pluginsOpen && }
; } setAnalyticsEnabled(false); applySkin(readSkin()); createRoot(document.getElementById("root")!).render();