{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pages-default-notices",
  "title": "Default write notices",
  "description": "The notices of this session's unresolved submission and unresolved uploads, over the record and attachment blocks' own notices and `@registrystack/app-runtime`'s recovery and pending-upload hooks, each attempt handed on as `reference`.",
  "dependencies": [
    "@registrystack/app-runtime@~0.43.0-next.0"
  ],
  "registryDependencies": [
    "@registrystack/pages-record",
    "@registrystack/pages-record-attachments"
  ],
  "files": [
    {
      "path": "pages/default-notices.tsx",
      "content": "import {\n  usePendingUploads,\n  useRecordRecovery,\n  withReference,\n  type RecoveryReference,\n} from \"@registrystack/app-runtime/react\";\nimport {\n  PendingUploadsNotice as RecordPendingUploadsNotice,\n  type PendingUploadsState,\n} from \"@/blocks/pages/record-attachments\";\nimport {\n  RecoveryNotice as RecordRecoveryNotice,\n  type RecoveryOutcome,\n} from \"@/blocks/pages/record\";\n\nfunction useRecovery(\n  reference: RecoveryReference,\n  options: {\n    onSettled: () => void;\n    open: (resource: { id: string; entity: string }) => void;\n  },\n): RecoveryOutcome {\n  return withReference(useRecordRecovery(reference, options));\n}\n\n/**\n * The unresolved submission of this session that needs checking, over\n * `@/blocks/pages/record`'s own `RecoveryNotice` and app-runtime's recovery\n * command.\n */\nexport function RecoveryNotice() {\n  return <RecordRecoveryNotice useRecovery={useRecovery} />;\n}\n\n/** This session's unresolved uploads, in the shape the block's notice reads. */\nfunction usePending(): PendingUploadsState {\n  const pending = usePendingUploads();\n  return {\n    orphaned: pending.orphaned,\n    forgetOrphaned: pending.forgetOrphaned,\n    live: pending.live.map(withReference),\n  };\n}\n\n/**\n * Every unresolved upload of this session, for the notice of writes that need\n * checking. A previous session's upload is shown without its reference, which\n * that session took with it. The record or request that is open shows its own\n * uploads in their slots, so they are left out here; an upload from the first\n * marker version stays, since no slot claims it.\n */\nexport function PendingUploadsNotice() {\n  return <RecordPendingUploadsNotice usePending={usePending} />;\n}\n",
      "type": "registry:block",
      "target": "@components/pages/default-notices.tsx"
    }
  ],
  "type": "registry:block"
}