{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sonner-promise",
  "title": "Promise toast with loading state",
  "description": "Promise toast with loading state, built from the sonner component.",
  "dependencies": [
    "sonner"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/patterns/sonner-promise/sonner-promise.tsx",
      "content": "/**\n * Promise toast with loading state - adapted for tealmac UI from the ReUI example \"c-sonner-7\"\n * (https://github.com/keenthemes/reui), MIT License, Copyright (c) 2025\n * Keenthemes Inc. The full licence text is in THIRD_PARTY_NOTICES.md.\n * Changes: tealmac UI import paths and theme tokens, lucide icons, logical\n * (RTL-safe) spacing and alignment, reduced-motion support and sample\n * content.\n */\n\"use client\"\n\nimport { toast } from \"sonner\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport function SonnerPromise() {\n  const handleDeploy = () => {\n    toast.promise(\n      new Promise<{ name: string }>((resolve) =>\n        setTimeout(() => resolve({ name: \"production\" }), 2000)\n      ),\n      {\n        loading: \"Deploying to production...\",\n        success: (data) => `Deployed to ${data.name} successfully`,\n        error: \"Deployment failed. Please try again.\",\n      }\n    )\n  }\n\n  return (\n    <div className=\"flex items-center justify-center\">\n      <Button onClick={handleDeploy} variant=\"outline\" className=\"w-fit\">\n        Deploy\n      </Button>\n    </div>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}