Repository Public
1// SP Vault Connect & Agents: managed secrets (NOT zero-knowledge), workload identities, grants, approvals, kill switch.2import { useCallback, useEffect, useState } from "react";3import { confirmAction, copyText, dateTime, engine, onLive, relTime, reportError, toast } from "../state.ts";4import { Badge, Btn, Callout, Dialog, Empty, ErrorText, Field, Icon, PageHead, Section, Segmented, Skeleton, useAction } from "./common.tsx";56const BANNER = "Managed secrets are NOT zero-knowledge: this server can decrypt them so it can use them on your behalf. Never move personal passwords here.";7const KINDS = [["http-bearer", "HTTP bearer token"], ["http-header", "HTTP custom header"], ["http-basic", "HTTP basic auth"], ["hmac", "HMAC signing key"], ["raw", "Raw secret"]] as const;8const METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"] as const;9const GRANT_EXPIRY = [{ value: 3600, label: "1 hour" }, { value: 86400, label: "1 day" }, { value: 7 * 86400, label: "7 days" }, { value: 30 * 86400, label: "30 days" }, { value: 90 * 86400, label: "90 days" }, { value: 365 * 86400, label: "1 year" }];1011function SecretDialog({ onClose, onDone }: { onClose: () => void; onDone: () => void }) {12 const [name, setName] = useState(""), [kind, setKind] = useState<string>("http-bearer"), [hosts, setHosts] = useState(""), [methods, setMethods] = useState<string[]>(["GET", "POST"]);13 const [header, setHeader] = useState(""), [prefix, setPrefix] = useState(""), [username, setUsername] = useState(""), [value, setValue] = useState(""), [rotate, setRotate] = useState("");14 const [ack, setAck] = useState(false);15 const act = useAction();16 const http = kind.startsWith("http-");17 const hostList = hosts.split(/[\s,]+/).map((h) => h.trim().toLowerCase()).filter(Boolean);18 const ready = name.trim() && value && ack && (!http || hostList.length > 0) && (kind !== "http-header" || header.trim());19 const create = () => act.run(async () => {20 const config: Record<string, unknown> = http ? { allowedHosts: hostList, allowedMethods: methods } : {};21 if (kind === "http-header") { config.header = header.trim(); if (prefix) config.prefix = prefix; }22 if (kind === "http-bearer" && prefix) config.prefix = prefix;23 if (kind === "http-basic" && username) config.username = username;24 const days = Math.floor(Number(rotate));25 await engine.createManagedSecret({ name: name.trim(), kind, config, value, rotateEveryDays: rotate && days > 0 ? days : undefined });26 toast("Managed secret created", "ok"); onDone(); onClose();27 });28 return (29 <Dialog title="New managed secret" wide onClose={onClose} footer={<><Btn onClick={onClose}>Cancel</Btn><Btn variant="primary" onClick={create} busy={act.busy} disabled={!ready} data-testid="msecret-create">Create</Btn></>}>30 <div className="stack">31 <Callout kind="danger" title="Not zero-knowledge"><p>{BANNER}</p></Callout>32 <div className="grid-2">33 <Field label="Name"><input className="input" value={name} onChange={(e) => setName(e.target.value)} maxLength={80} data-autofocus data-testid="msecret-name" /></Field>34 <Field label="Kind"><select className="input" value={kind} onChange={(e) => setKind(e.target.value)} data-testid="msecret-kind">{KINDS.map(([v, l]) => <option key={v} value={v}>{l}</option>)}</select></Field>35 </div>36 {http && (37 <>38 <Field label="Allowed hosts" hint="Comma-separated. The credential is only ever sent to these hosts (use *.example.com for subdomains)."><input className="input mono" value={hosts} onChange={(e) => setHosts(e.target.value)} placeholder="api.example.com" spellCheck={false} autoCapitalize="none" data-testid="msecret-hosts" /></Field>39 <div className="field"><span className="field-label">Allowed methods</span>40 <div className="check-grid" role="group" aria-label="Allowed methods">{METHODS.map((m) => <label key={m} className="check"><input type="checkbox" checked={methods.includes(m)} onChange={(e) => setMethods(e.target.checked ? [...methods, m] : methods.filter((x) => x !== m))} /><span className="mono">{m}</span></label>)}</div>41 </div>42 </>43 )}44 {kind === "http-header" && <div className="grid-2"><Field label="Header name"><input className="input mono" value={header} onChange={(e) => setHeader(e.target.value)} placeholder="X-Api-Key" spellCheck={false} /></Field><Field label="Value prefix (optional)"><input className="input mono" value={prefix} onChange={(e) => setPrefix(e.target.value)} maxLength={32} spellCheck={false} /></Field></div>}45 {kind === "http-bearer" && <Field label="Prefix (optional)" hint="Defaults to “Bearer ”."><input className="input mono" value={prefix} onChange={(e) => setPrefix(e.target.value)} maxLength={32} spellCheck={false} /></Field>}46 {kind === "http-basic" && <Field label="Username"><input className="input" value={username} onChange={(e) => setUsername(e.target.value)} maxLength={128} autoComplete="off" spellCheck={false} /></Field>}47 <Field label="Secret value" hint="Sent to the server over TLS and stored encrypted under a key the server holds."><input className="input mono" type="password" value={value} onChange={(e) => setValue(e.target.value)} autoComplete="new-password" spellCheck={false} data-testid="msecret-value" /></Field>48 <Field label="Rotation reminder (days, optional)"><input className="input" type="number" min={1} max={3650} value={rotate} onChange={(e) => setRotate(e.target.value)} /></Field>49 <label className="check"><input type="checkbox" checked={ack} onChange={(e) => setAck(e.target.checked)} data-testid="msecret-ack" /><span>I understand that the server operator can read this secret, and that it is not one of my personal passwords.</span></label>50 <ErrorText text={act.error} />51 </div>52 </Dialog>53 );54}5556function RotateDialog({ secret, onClose, onDone }: { secret: any; onClose: () => void; onDone: () => void }) {57 const [value, setValue] = useState("");58 const act = useAction();59 const go = () => act.run(async () => { await engine.rotateManagedSecret(secret.id, value); toast("Value replaced; every lease on this secret ended", "ok"); onDone(); onClose(); });60 return (61 <Dialog title={`Rotate “${secret.name}”`} onClose={onClose} footer={<><Btn onClick={onClose}>Cancel</Btn><Btn variant="primary" onClick={go} busy={act.busy} disabled={!value}>Replace value</Btn></>}>62 <div className="stack">63 <p className="muted">The new value replaces version {secret.version}. Every active lease on this secret ends immediately; grants stay in place.</p>64 <Field label="New value"><input className="input mono" type="password" value={value} onChange={(e) => setValue(e.target.value)} autoComplete="new-password" spellCheck={false} data-autofocus /></Field>65 <ErrorText text={act.error} />66 </div>67 </Dialog>68 );69}7071function IdentityDialog({ onClose, onDone }: { onClose: () => void; onDone: () => void }) {72 const [name, setName] = useState(""), [kind, setKind] = useState<"service" | "agent">("agent");73 const [created, setCreated] = useState<{ id: string; privateKey: string } | null>(null);74 const act = useAction();75 const create = () => act.run(async () => { setCreated(await engine.createIdentity(name.trim(), kind)); onDone(); });76 if (created) {77 const example = [78 `import { AgentClient } from "./packages/agent-client/index.ts";`, ``,79 `// Keep the private key in the workload's own secret store, never in source control.`,80 `const agent = new AgentClient("${location.origin}", "${created.id}", process.env.SPV_AGENT_KEY);`, ``,81 `// Brokered call: SP Vault injects the credential; this process never sees it.`,82 `const res = await agent.http("<grant id>", { method: "GET", url: "https://api.example.com/v1/me" }, "why this call is needed");`,83 `console.log(res.status);`,84 ].join("\n");85 return (86 <Dialog title="Identity created" wide onClose={onClose} footer={<Btn variant="primary" onClick={onClose}>I stored the key — done</Btn>}>87 <div className="stack">88 <Callout kind="warn" title="The private key is shown once"><p>It was generated in this browser; the server only received the public key. Store it in the workload's secret store now — it cannot be displayed again.</p></Callout>89 <Field label="Identity ID"><div className="input-row"><input className="input mono" readOnly value={created.id} data-testid="identity-id" /><Btn icon="copy" onClick={() => copyText(created.id, "Identity ID", false)}>Copy</Btn></div></Field>90 <Field label="Private key (SPV_AGENT_KEY)"><div className="input-row"><input className="input mono" readOnly type="password" value={created.privateKey} data-testid="identity-key" /><Btn variant="primary" icon="copy" onClick={() => copyText(created.privateKey, "Private key")}>Copy</Btn></div></Field>91 <Field label="Node.js example"><pre className="code" data-testid="identity-example">{example}</pre></Field>92 <Btn icon="copy" onClick={() => copyText(example, "Example", false)}>Copy example</Btn>93 </div>94 </Dialog>95 );96 }97 return (98 <Dialog title="New workload identity" onClose={onClose} footer={<><Btn onClick={onClose}>Cancel</Btn><Btn variant="primary" onClick={create} busy={act.busy} disabled={!name.trim()} data-testid="identity-create">Create identity</Btn></>}>99 <div className="stack">100 <Field label="Name"><input className="input" value={name} onChange={(e) => setName(e.target.value)} maxLength={64} data-autofocus data-testid="identity-name" /></Field>101 <Field label="Kind"><Segmented label="Kind" value={kind} onChange={setKind} options={[{ value: "agent", label: "Agent (AI, autonomous)" }, { value: "service", label: "Service (deterministic)" }]} /></Field>102 <p className="muted small">{kind === "agent" ? "Agents always need a human approval, per lease or per use. They never get access to your personal vault." : "Services run fixed code and may be granted unattended access to a specific secret."}</p>103 <p className="fine">A signing key pair is generated here. An identity can do nothing until you create a grant for it.</p>104 <ErrorText text={act.error} />105 </div>106 </Dialog>107 );108}109110function GrantDialog({ data, onClose, onDone }: { data: any; onClose: () => void; onDone: () => void }) {111 const ids = data.identities.filter((i: any) => !i.revoked), secrets = data.secrets as any[];112 const [identityId, setIdentityId] = useState<string>(ids[0]?.id ?? ""), [secretId, setSecretId] = useState<string>(secrets[0]?.id ?? "");113 const [mode, setMode] = useState<"operate" | "read">("operate"), [approval, setApproval] = useState<"never" | "lease" | "each">("lease");114 const [leaseMin, setLeaseMin] = useState("5"), [maxUses, setMaxUses] = useState(""), [expiry, setExpiry] = useState(7 * 86400), [methods, setMethods] = useState<string[]>([]), [pathPrefix, setPathPrefix] = useState("");115 const act = useAction();116 const identity = ids.find((i: any) => i.id === identityId), isAgent = identity?.kind === "agent";117 const effApproval = isAgent && approval === "never" ? "lease" : approval;118 const pathOk = !pathPrefix || /^\/[^\s]{0,200}$/.test(pathPrefix);119 const create = () => act.run(async () => {120 const constraints: Record<string, unknown> = {};121 if (methods.length) constraints.methods = methods;122 if (pathPrefix) constraints.pathPrefix = pathPrefix;123 const uses = Math.floor(Number(maxUses));124 await engine.createGrant({ identityId, secretId, mode, approval: effApproval, expiresInSec: expiry, leaseTtlSec: Math.max(30, Math.min(3600, Math.round(Number(leaseMin) * 60) || 300)), maxUses: maxUses && uses > 0 ? uses : undefined, constraints });125 toast("Grant created", "ok"); onDone(); onClose();126 });127 return (128 <Dialog title="New grant" wide onClose={onClose} footer={<><Btn onClick={onClose}>Cancel</Btn><Btn variant="primary" onClick={create} busy={act.busy} disabled={!identityId || !secretId || !pathOk} data-testid="grant-create">Create grant</Btn></>}>129 <div className="stack">130 <div className="grid-2">131 <Field label="Identity"><select className="input" value={identityId} onChange={(e) => setIdentityId(e.target.value)} data-autofocus>{ids.map((i: any) => <option key={i.id} value={i.id}>{i.name} ({i.kind})</option>)}</select></Field>132 <Field label="Managed secret"><select className="input" value={secretId} onChange={(e) => setSecretId(e.target.value)}>{secrets.map((s) => <option key={s.id} value={s.id}>{s.name}</option>)}</select></Field>133 </div>134 <Field label="Mode"><Segmented label="Mode" value={mode} onChange={setMode} options={[{ value: "operate", label: "Operate (brokered)" }, { value: "read", label: "Read (raw value)" }]} /></Field>135 {mode === "operate"136 ? <p className="muted small">SP Vault performs the HTTP call or signature itself and injects the credential. The workload never sees the secret.</p>137 : <Callout kind="danger" title="Read hands over the raw secret"><p>The workload receives the secret itself and can then disclose it — in logs, in a prompt, to another service. Every read needs a human approval. Prefer “operate”.</p></Callout>}138 <Field label="Human approval">139 <Segmented label="Approval" value={effApproval} onChange={setApproval} options={[...(isAgent ? [] : [{ value: "never" as const, label: "Never" }]), { value: "lease", label: "Per lease" }, { value: "each", label: "Each use" }]} />140 </Field>141 <p className="muted small">{isAgent ? "Agents cannot have “never”: " : ""}{effApproval === "never" ? "The service uses the secret unattended, within the limits below." : effApproval === "lease" ? "You approve once; the identity may then use the secret until the lease expires." : "You approve every single use."}</p>142 <div className="grid-2">143 <Field label="Lease duration (minutes)" hint="0.5 – 60"><input className="input" type="number" min={0.5} max={60} step={0.5} value={leaseMin} onChange={(e) => setLeaseMin(e.target.value)} disabled={effApproval !== "lease"} /></Field>144 <Field label="Maximum uses (optional)"><input className="input" type="number" min={1} value={maxUses} onChange={(e) => setMaxUses(e.target.value)} /></Field>145 <Field label="Grant expires after"><select className="input" value={expiry} onChange={(e) => setExpiry(Number(e.target.value))}>{GRANT_EXPIRY.map((o) => <option key={o.value} value={o.value}>{o.label}</option>)}</select></Field>146 <Field label="Path prefix (optional)" error={pathOk ? undefined : "Must start with / and contain no spaces"}><input className="input mono" value={pathPrefix} onChange={(e) => setPathPrefix(e.target.value)} placeholder="/v1/" spellCheck={false} /></Field>147 </div>148 <div className="field"><span className="field-label">Restrict methods (optional)</span>149 <div className="check-grid" role="group" aria-label="Restrict methods">{METHODS.map((m) => <label key={m} className="check"><input type="checkbox" checked={methods.includes(m)} onChange={(e) => setMethods(e.target.checked ? [...methods, m] : methods.filter((x) => x !== m))} /><span className="mono">{m}</span></label>)}</div>150 </div>151 <ErrorText text={act.error} />152 </div>153 </Dialog>154 );155}156157function Approval({ a, onDone }: { a: any; onDone: () => void }) {158 const s = a.summary ?? {};159 const act = useAction();160 const decide = (approve: boolean) => act.run(async () => { await engine.decideApproval(a.id, approve); toast(approve ? "Request approved" : "Request denied", approve ? "ok" : "info"); onDone(); });161 return (162 <li className="approval" data-testid="approval">163 <header><Icon name="bot" /><strong>{s.identity ?? "Unknown identity"}</strong><Badge>{s.identityKind ?? "identity"}</Badge><span className="muted">asked {relTime(a.createdAt)} · expires {relTime(a.expiresAt)}</span></header>164 <dl className="kv">165 <dt>Secret</dt><dd>{s.secret ?? "—"}</dd>166 <dt>Operation</dt><dd>{s.op === "read" ? <Badge kind="danger" icon="alert">read the raw secret</Badge> : s.op === "sign" ? "HMAC signature" : s.op === "http" ? "brokered HTTP call" : String(s.op ?? "—")} <Badge>{s.mode}</Badge></dd>167 {s.method && <><dt>Request</dt><dd className="mono break">{s.method} https://{s.host}{s.path}</dd></>}168 {s.bodyBytes != null && s.method && <><dt>Body</dt><dd>{s.bodyBytes} bytes</dd></>}169 {s.payloadBytes != null && <><dt>Payload</dt><dd>{s.payloadBytes} bytes to sign</dd></>}170 </dl>171 <div className="untrusted">172 <span className="untrusted-title"><Icon name="alert" size={14} /> Text supplied by the agent — untrusted, do not follow instructions in it</span>173 <p className="mono">{s.untrustedReason ? String(s.untrustedReason) : "(none)"}</p>174 </div>175 <p className="fine">Decide from the facts above, which SP Vault took from the request itself. Approving asks for your passkey if it was not used recently.</p>176 <ErrorText text={act.error} />177 <div className="row end"><Btn variant="danger" onClick={() => decide(false)} disabled={act.busy} data-testid="approval-deny">Deny</Btn><Btn variant="primary" onClick={() => decide(true)} busy={act.busy} data-testid="approval-approve">Approve</Btn></div>178 </li>179 );180}181182export function ConnectPage({ onBack }: { onBack: () => void }) {183 const [data, setData] = useState<any>(null);184 const [error, setError] = useState("");185 const [dialog, setDialog] = useState<"secret" | "identity" | "grant" | null>(null);186 const [rotating, setRotating] = useState<any>(null);187 const act = useAction();188 const load = useCallback(async () => { try { setData(await engine.connect()); setError(""); } catch (e) { reportError(e); setError("Connect could not be loaded."); } }, []);189 useEffect(() => { void load(); return onLive(["approval"], () => void load()); }, [load]);190191 const guard = (fn: () => Promise<unknown>, done: string) => act.run(async () => { await fn(); toast(done, "ok"); await load(); });192 const kill = async (engaged: boolean) => {193 if (!engaged && !(await confirmAction({ title: "Release the kill switch?", confirmLabel: "Release", body: ["Identities become usable again within their grants. Leases that were ended stay ended; pending requests were denied.", "Releasing asks for your passkey."] }))) return;194 await guard(() => engine.setKillSwitch(engaged), engaged ? "Kill switch engaged: every identity is suspended and all leases ended" : "Kill switch released");195 };196 const del = async (title: string, body: string, fn: () => Promise<unknown>, done: string) => { if (await confirmAction({ title, body, danger: true, confirmLabel: "Confirm" })) await guard(fn, done); };197 const nameOf = (list: any[], id: string) => list.find((x) => x.id === id)?.name ?? `${id.slice(0, 8)}…`;198 const pending = (data?.approvals ?? []).filter((a: any) => a.status === "pending");199200 return (201 <div className="page" data-testid="connect-page">202 <PageHead title="Connect & Agents" sub="Let services and AI agents use specific credentials without ever touching your personal vault." onBack={onBack} />203 <Callout kind="danger" title="Different trust model"><p data-testid="connect-banner">{BANNER}</p></Callout>204 <ErrorText text={error || act.error} />205 {!data && !error ? <Skeleton rows={3} /> : data && !data.enabled ? (206 <Empty icon="bot" title="Connect is not enabled on this server">The managed-secrets service is a separate, isolated process that the operator has not switched on. Your personal vault is unaffected; nothing here is required to use SP Vault.</Empty>207 ) : data && (208 <>209 <section className={`kill${data.killed ? " engaged" : ""}`} data-testid="kill" aria-label="Kill switch">210 <span className="kill-icon"><Icon name="power" size={26} /></span>211 <div><h2>{data.killed ? "Kill switch ENGAGED" : "Kill switch"}</h2><p>{data.killed ? "Every service and agent identity is suspended. No managed secret can be used." : "Suspends every identity at once, ends all leases and denies pending requests. One click, no confirmation."}</p></div>212 {data.killed ? <Btn onClick={() => kill(false)} busy={act.busy} data-testid="kill-release">Release…</Btn> : <Btn variant="danger" icon="power" onClick={() => kill(true)} busy={act.busy} data-testid="kill-engage">Stop all agents</Btn>}213 </section>214215 <Section title={`Pending approvals${pending.length ? ` (${pending.length})` : ""}`}>216 {pending.length === 0 ? <p className="muted">No request is waiting for you.</p> : <ul className="approvals">{pending.map((a: any) => <Approval key={a.id} a={a} onDone={load} />)}</ul>}217 </Section>218219 <Section title="Managed secrets" actions={<Btn small icon="plus" onClick={() => setDialog("secret")} data-testid="msecret-new">New secret</Btn>}>220 {data.secrets.length === 0 ? <p className="muted">No managed secret. Create one for an API credential that a workload should use.</p> : (221 <ul className="rows">{data.secrets.map((s: any) => (222 <li key={s.id} className="row-card">223 <div className="row-main"><strong>{s.name} <Badge>{s.kind}</Badge> <Badge>v{s.version}</Badge></strong>224 <span className="muted">{s.config?.allowedHosts?.length ? `Hosts: ${s.config.allowedHosts.join(", ")} · ${(s.config.allowedMethods ?? []).join(" ")}` : "No HTTP use"} · {s.rotatedAt ? `rotated ${relTime(s.rotatedAt)}` : `created ${relTime(s.createdAt)}`}{s.rotateEveryDays ? ` · rotate every ${s.rotateEveryDays} d` : ""}</span></div>225 <Btn small icon="refresh" onClick={() => setRotating(s)}>Rotate</Btn>226 <Btn small variant="danger" onClick={() => del(`Delete “${s.name}”?`, "The stored value is erased and every grant on it is revoked.", () => engine.deleteManagedSecret(s.id), "Managed secret deleted")}>Delete</Btn>227 </li>))}</ul>228 )}229 </Section>230231 <Section title="Identities" actions={<Btn small icon="plus" onClick={() => setDialog("identity")} data-testid="identity-new">New identity</Btn>}>232 {data.identities.length === 0 ? <p className="muted">No workload identity yet.</p> : (233 <ul className="rows">{data.identities.map((i: any) => (234 <li key={i.id} className="row-card">235 <div className="row-main"><strong>{i.name} <Badge kind={i.kind === "agent" ? "brass" : "neutral"}>{i.kind}</Badge> {i.revoked && <Badge kind="danger">revoked</Badge>}</strong>236 <span className="muted mono small">{i.id}</span><span className="muted">Created {relTime(i.createdAt)} · last used {relTime(i.lastUsedAt)}</span></div>237 {!i.revoked && <Btn small variant="danger" onClick={() => del(`Revoke “${i.name}”?`, "Its key stops working immediately. This cannot be undone; create a new identity to replace it.", () => engine.revokeIdentity(i.id), "Identity revoked")}>Revoke</Btn>}238 </li>))}</ul>239 )}240 </Section>241242 <Section title="Grants" actions={<Btn small icon="plus" onClick={() => setDialog("grant")} disabled={!data.secrets.length || !data.identities.some((i: any) => !i.revoked)} data-testid="grant-new">New grant</Btn>}>243 <p className="muted small">A grant lets one identity use one secret. “Operate” keeps the secret inside SP Vault; “read” hands the raw secret to the workload, which can then disclose it.</p>244 {data.grants.length === 0 ? <p className="muted">No grant.</p> : (245 <ul className="rows">{data.grants.map((g: any) => {246 const dead = g.revoked || new Date(g.expiresAt) < new Date();247 return (248 <li key={g.id} className="row-card">249 <div className="row-main"><strong>{nameOf(data.identities, g.identityId)} → {nameOf(data.secrets, g.secretId)} {g.revoked ? <Badge kind="danger">revoked</Badge> : dead ? <Badge>expired</Badge> : <Badge kind="ok">active</Badge>}</strong>250 <span className="row wrap badges"><Badge kind={g.mode === "read" ? "danger" : "accent"}>{g.mode}</Badge><Badge>approval: {g.approval}</Badge>{g.approval === "lease" && <Badge>lease {Math.round(g.leaseTtlSec / 60)} min</Badge>}<Badge>{g.uses}{g.maxUses ? ` / ${g.maxUses}` : ""} uses</Badge>{g.constraints?.methods?.length ? <Badge>{g.constraints.methods.join(" ")}</Badge> : null}{g.constraints?.pathPrefix ? <Badge>{g.constraints.pathPrefix}*</Badge> : null}</span>251 <span className="muted">Expires {dateTime(g.expiresAt)} · <span className="mono small">{g.id}</span></span></div>252 {!dead && <Btn small variant="danger" onClick={() => del("Revoke this grant?", "The identity loses access to this secret and its leases end.", () => engine.revokeGrant(g.id), "Grant revoked")}>Revoke</Btn>}253 </li>);254 })}</ul>255 )}256 </Section>257 </>258 )}259 {dialog === "secret" && <SecretDialog onClose={() => setDialog(null)} onDone={load} />}260 {dialog === "identity" && <IdentityDialog onClose={() => setDialog(null)} onDone={load} />}261 {dialog === "grant" && data && <GrantDialog data={data} onClose={() => setDialog(null)} onDone={load} />}262 {rotating && <RotateDialog secret={rotating} onClose={() => setRotating(null)} onDone={load} />}263 </div>264 );265}266