import { useState } from "react"; import { createRoot } from "react-dom/client"; import { Collapsible as Primitive } from "radix-ui"; import { ZCodeIntlProvider } from "@/i18n/IntlProvider.js"; import { ToolLayout } from "@/ToolCallBlocks/ToolLayout.js"; import { TooltipProvider } from "@/components/ui/tooltip.js"; import { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from "@/components/ui/accordion.js"; import "@/styles.css"; const query = new URLSearchParams(location.search); const theme = query.get("theme") === "light" ? "light" : "dark"; document.documentElement.className = `${theme} theme-zai-${theme}`; function Fixture() { const [mounted, setMounted] = useState(false); const [narrow, setNarrow] = useState(false); const [special, setSpecial] = useState(false); const [running, setRunning] = useState(true); return ( setMounted((value) => !value)}>Mount setNarrow((value) => !value)}>Width setSpecial(true)}>Special setRunning(false)}>Complete {mounted && Array.from({ length: 134 }, (_, index) => ( •} kindLabel="Tool" primaryText={`历史工具 ${index}`} renderContent={() => ( {"完整详情必须保留。 Details remain available. ".repeat(6)} {index === 0 && ( •} kindLabel="Nested" primaryText="子工具" renderContent={() => Nested detail} /> )} )} /> ))} {special && ( Default open Default detail Force mount Forced detail Disabled Disabled detail •} kindLabel="Auto" primaryText="Auto open" autoOpen isRunning={running} autoCollapseOnComplete renderContent={() => Automatic detail} /> Accordion Accordion detail )} ); } createRoot(document.getElementById("root")!).render();
{"完整详情必须保留。 Details remain available. ".repeat(6)}
Nested detail
Automatic detail