mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
React.lazy expects default exports, but all finance registry files were using named exports. This caused build failures with the error: "Element type is invalid: expected a string ... but got: undefined" Changes: - Updated all finance registry files to import and re-export as default - Removed non-existent mini-chart and symbol-overview MDX files - Updated sidebar navigation to remove mini-chart and symbol-overview - Fixed market-overview, ticker-tape, and trading-panel registry files The finance components now properly load in ComponentPreview during static site generation.
10 lines
2.3 KiB
JSON
10 lines
2.3 KiB
JSON
{
|
|
"name": "sandbox",
|
|
"files": [
|
|
{
|
|
"name": "sandbox.tsx",
|
|
"content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface SandboxProps extends React.HTMLAttributes<HTMLDivElement> {\n code?: string\n language?: string\n editable?: boolean\n}\n\nconst Sandbox = React.forwardRef<HTMLDivElement, SandboxProps>(\n (\n {\n className,\n code = \"\",\n language = \"javascript\",\n editable = false,\n ...props\n },\n ref\n ) => {\n const [value, setValue] = React.useState(code)\n const [output, setOutput] = React.useState<string>(\"\")\n\n const handleRun = () => {\n try {\n // This is a placeholder - in production, use a proper sandboxed execution environment\n const result = eval(value)\n setOutput(String(result))\n } catch (error) {\n setOutput(\n `Error: ${error instanceof Error ? error.message : String(error)}`\n )\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n \"grid gap-4 rounded-lg border bg-card text-card-foreground shadow-sm\",\n className\n )}\n {...props}\n >\n <div className=\"space-y-2 p-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm font-medium\">Code Editor</span>\n <button\n onClick={handleRun}\n className=\"rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground hover:bg-primary/90\"\n >\n Run\n </button>\n </div>\n <textarea\n value={value}\n onChange={(e) => setValue(e.target.value)}\n readOnly={!editable}\n className=\"min-h-[200px] w-full rounded-md border bg-muted p-4 font-mono text-sm\"\n placeholder=\"Enter your code here...\"\n />\n </div>\n\n {output && (\n <div className=\"space-y-2 border-t p-4\">\n <span className=\"text-sm font-medium\">Output</span>\n <pre className=\"rounded-md bg-muted p-4 text-sm\">\n <code>{output}</code>\n </pre>\n </div>\n )}\n </div>\n )\n }\n)\n\nSandbox.displayName = \"Sandbox\"\n\nexport { Sandbox }\n"
|
|
}
|
|
],
|
|
"type": "components:ui"
|
|
} |