{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "activity",
  "type": "registry:block",
  "title": "Stridge Activity",
  "description": "Providers + activity flow only. Drops `components/stridge/providers.tsx` and the activity composition stubs.",
  "dependencies": [
    "@stridge/kit"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "components/stridge/providers.tsx",
      "content": "\"use client\";\n\nimport { StridgeProvider } from \"@stridge/kit\";\nimport type { ReactNode } from \"react\";\n\ninterface Props {\n    children: ReactNode;\n}\n\n/**\n * Fail fast at module load when the workspace's gateway key is missing — without it every\n * driver call dies later with an opaque 4xx and integrators waste time chasing a misconfigured\n * env var. Pull yours from `Developer → Gateway Kit → Connection` in the Stridge dashboard.\n *\n * Wrapped in a function so TypeScript narrows `gatewayKey` to `string` past the assertion —\n * a top-level `throw` doesn't propagate the narrowing to subsequent module statements.\n */\nfunction requireGatewayKey(): string {\n    const key = process.env.NEXT_PUBLIC_STRIDGE_GATEWAY_KEY;\n    if (!key) {\n        throw new Error(\n            \"NEXT_PUBLIC_STRIDGE_GATEWAY_KEY is not set — add it to .env.local before mounting <StridgeAppProvider>.\",\n        );\n    }\n    return key;\n}\n\nconst gatewayKey = requireGatewayKey();\n\n/**\n * Wrap your app's root layout with this provider once. Every flow (deposit, withdraw, …) reads\n * its config off here — fill in the `TODO`s with your gateway key, settlement destination, and\n * any per-flow tuning you need.\n */\nexport function StridgeAppProvider({ children }: Props) {\n    return (\n        <StridgeProvider\n            environment=\"staging\"\n            gatewayKey={gatewayKey}\n            asset={{ networkId: \"1\", symbol: \"USDC\" }}\n            flows={{\n                deposit: {\n                    destination: { address: \"0x0000000000000000000000000000000000000000\" },\n                },\n                withdraw: {\n                    owner: { address: \"0x0000000000000000000000000000000000000000\" },\n                },\n            }}\n        >\n            {children}\n        </StridgeProvider>\n    );\n}\n",
      "type": "registry:component",
      "target": "components/stridge/providers.tsx"
    },
    {
      "path": "components/stridge/activity/activity.tsx",
      "content": "\"use client\";\n\nimport { useActivity, useActivityState } from \"@stridge/kit\";\nimport { ActivityFlow } from \"@stridge/kit/activity/compound\";\nimport { Dialog } from \"@stridge/kit/ui\";\n\nimport { StridgeActivityDetail } from \"./activity-detail\";\nimport { StridgeActivityList } from \"./activity-list\";\n\n/**\n * Default standalone activity composition. Mount once anywhere inside `<StridgeAppProvider>`;\n * open it from elsewhere with `useActivity().open()` or `useActivity().open({ settlementId })`.\n * The dialog is a pure composition of compound parts:\n *\n * - `<ActivityFlow.Boundary>` catches render crashes and pipes recovery through `useActivity().close()`.\n * - `<ActivityFlow.Steps>` routes the FSM state to the matching `<ActivityFlow.Step>` child.\n *\n * Interleave your own elements between any two parts, or replace a single `<ActivityFlow.Step>`\n * child with your own panel — the wiring stays inside the kit.\n */\nexport function StridgeActivity() {\n    const state = useActivityState();\n    const { close } = useActivity();\n    return (\n        <Dialog\n            open={state.name !== \"closed\"}\n            onOpenChange={(next: boolean) => {\n                if (!next) close();\n            }}\n        >\n            <Dialog.Content>\n                <ActivityFlow.Boundary>\n                    <ActivityFlow.Steps>\n                        <ActivityFlow.Step name=\"activityList\">\n                            <StridgeActivityList />\n                        </ActivityFlow.Step>\n                        <ActivityFlow.Step name=\"activityDetail\">\n                            <StridgeActivityDetail />\n                        </ActivityFlow.Step>\n                    </ActivityFlow.Steps>\n                </ActivityFlow.Boundary>\n            </Dialog.Content>\n        </Dialog>\n    );\n}\n",
      "type": "registry:component",
      "target": "components/stridge/activity/activity.tsx"
    },
    {
      "path": "components/stridge/activity/activity-list.tsx",
      "content": "\"use client\";\n\nimport { ActivityList } from \"@stridge/kit/activity/widgets\";\n\n/**\n * Standalone activity list step. Mounts the activity-orchestrated list wrapper with the\n * compound's default composition — `<Header /> + <List />`. Interleave your own elements\n * between the sub-parts to customise.\n */\nexport function StridgeActivityList() {\n    return (\n        <ActivityList>\n            <ActivityList.Header />\n            <ActivityList.List />\n        </ActivityList>\n    );\n}\n",
      "type": "registry:component",
      "target": "components/stridge/activity/activity-list.tsx"
    },
    {
      "path": "components/stridge/activity/activity-detail.tsx",
      "content": "\"use client\";\n\nimport { ActivityDetail } from \"@stridge/kit/activity/widgets\";\n\n/**\n * Standalone activity per-settlement detail step. Mounts all three per-kind parts of the\n * activity-orchestrated detail wrapper; each gates internally on the resolved payload's\n * `kind`, so only the matching one renders. Each part composes its corresponding state\n * compound (success / error / processing) with the same default composition the active-flow\n * widgets use — minus the action callbacks (activity detail is read-only).\n */\nexport function StridgeActivityDetail() {\n    return (\n        <ActivityDetail>\n            <ActivityDetail.Processing />\n            <ActivityDetail.Succeeded />\n            <ActivityDetail.Failed />\n        </ActivityDetail>\n    );\n}\n",
      "type": "registry:component",
      "target": "components/stridge/activity/activity-detail.tsx"
    }
  ]
}
