{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "split-button-action-demo",
"registryDependencies": [
"https://reusables.vercel.app/r/split-button-action",
"https://reusables.vercel.app/r/notify"
],
"files": [
{
"path": "registry/example/split-button-action-demo.tsx",
"content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { toast } from \"@/packages/notify/src\"\nimport {\n BriefcaseBusiness,\n CodeXml,\n Copy,\n Download,\n File,\n FileDown,\n FileJson,\n FileText,\n Image,\n Link,\n MessagesSquare,\n Share2,\n ThumbsUp,\n} from \"lucide-react\"\n\nimport SplitButtonAction from \"@/components/ui/split-button-action\"\n\nexport default function SplitButton2Demo() {\n const [loadingStates, setLoadingStates] = useState({\n download: false,\n share: false,\n export: false,\n small: false,\n default: false,\n large: false,\n })\n\n const handleAction = async (action: keyof typeof loadingStates) => {\n setLoadingStates((prev) => ({ ...prev, [action]: true }))\n await new Promise((resolve) => setTimeout(resolve, 2000))\n setLoadingStates((prev) => ({ ...prev, [action]: false }))\n toast.success(\n `${action.charAt(0).toUpperCase() + action.slice(1)} Successful`,\n {\n description: `Your ${action} action has been completed.`,\n }\n )\n }\n\n const options = [\n {\n label: \"Copy SVG\",\n onClick: () => {\n toast.success(\"Copied SVG\", {\n description: \"SVG code copied to clipboard\",\n })\n },\n icon: