{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toast-action",
  "title": "Toast Action",
  "description": "A simple sonner toast trigger with title, description, and undo action.",
  "dependencies": [
    "sonner"
  ],
  "registryDependencies": [
    "button",
    "sonner"
  ],
  "files": [
    {
      "path": "registry/corr/components/toast-action.tsx",
      "content": "import { toast } from \"sonner\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport type ToastActionType =\n  | \"default\"\n  | \"success\"\n  | \"info\"\n  | \"warning\"\n  | \"error\"\n\nexport function ToastAction({\n  label = \"Show toast\",\n  title = \"Saved\",\n  description = \"Your changes have been saved.\",\n  type = \"default\",\n  actionLabel = \"Undo\",\n}: {\n  label?: string\n  title?: string\n  description?: string\n  type?: ToastActionType\n  actionLabel?: string | null\n}) {\n  const showToast = () => {\n    const options = {\n      description,\n      action: actionLabel\n        ? {\n            label: actionLabel,\n            onClick: () => undefined,\n          }\n        : undefined,\n    }\n\n    if (type === \"success\") {\n      toast.success(title, options)\n      return\n    }\n\n    if (type === \"info\") {\n      toast.info(title, options)\n      return\n    }\n\n    if (type === \"warning\") {\n      toast.warning(title, options)\n      return\n    }\n\n    if (type === \"error\") {\n      toast.error(title, options)\n      return\n    }\n\n    toast(title, options)\n  }\n\n  return (\n    <Button variant=\"outline\" onClick={showToast}>\n      {label}\n    </Button>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}