{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "halving-countdown", "title": "Halving countdown", "description": "Block-based halving countdown and subsidy context.", "registryDependencies": [ "dennisonbertram/bitcoin-ui/bitcoin-core", "dennisonbertram/bitcoin-ui/bitcoin-theme" ], "files": [ { "path": "components/bitcoin/halving-countdown.tsx", "content": "import type { ComponentProps } from \"react\";\n\nimport { formatBlockHeight } from \"@/lib/bitcoin\";\nimport { componentClasses } from \"@/lib/utils\";\n\nimport { panelStyles, type BitcoinVisualProps } from \"./shared\";\n\nexport type HalvingCountdownProps = Omit<\n ComponentProps<\"section\">,\n \"children\"\n> &\n BitcoinVisualProps & {\n currentHeight: number;\n halvingHeight: number;\n estimatedDate?: string;\n currentSubsidy?: number;\n };\n\nexport function HalvingCountdown({\n currentHeight,\n halvingHeight,\n estimatedDate,\n currentSubsidy = 3.125,\n unstyled,\n className,\n ...props\n}: HalvingCountdownProps) {\n const remaining = Math.max(0, halvingHeight - currentHeight);\n const nextSubsidy = currentSubsidy / 2;\n\n return (\n \n
\n \n Next halving\n

\n \n {formatBlockHeight(remaining)}\n \n blocks\n \n

\n
\n \n
\n \n Target height\n \n \n {formatBlockHeight(halvingHeight)}\n \n
\n
\n \n Next subsidy\n \n \n {nextSubsidy} BTC\n \n
\n \n {estimatedDate ? (\n \n Estimated {estimatedDate}. Block time is probabilistic.\n

\n ) : null}\n \n );\n}\n", "type": "registry:component" } ], "type": "registry:component" }