{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "p-toast-5",
  "description": "Promise-based stacked toast",
  "registryDependencies": [
    "@coss/button",
    "@coss/toast"
  ],
  "files": [
    {
      "path": "registry/default/particles/p-toast-5.tsx",
      "content": "\"use client\";\n\nimport { Button } from \"@/registry/default/ui/button\";\nimport { toastManager } from \"@/registry/default/ui/toast\";\n\nexport default function Particle() {\n  return (\n    <Button\n      onClick={() => {\n        toastManager.promise(\n          new Promise<string>((resolve, reject) => {\n            const shouldSucceed = Math.random() > 0.3;\n            setTimeout(() => {\n              if (shouldSucceed) {\n                resolve(\"Data loaded successfully\");\n              } else {\n                reject(new Error(\"Failed to load data\"));\n              }\n            }, 2000);\n          }),\n          {\n            error: () => ({\n              description: \"Please try again.\",\n              title: \"Something went wrong\",\n            }),\n            loading: {\n              description: \"The promise is loading.\",\n              title: \"Loading…\",\n            },\n            success: (data: string) => ({\n              description: `Success: ${data}`,\n              title: \"This is a success toast!\",\n            }),\n          },\n        );\n      }}\n      variant=\"outline\"\n    >\n      Run Promise\n    </Button>\n  );\n}\n",
      "type": "registry:block"
    }
  ],
  "categories": [
    "toast"
  ],
  "type": "registry:block"
}