{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "crypto24",
  "title": "DAO Governance Proposals",
  "description": "Governance proposal cards with for/against vote bars and quorum progress. Status badges (active, passed, rejected), countdown timers, and proposer addresses.",
  "dependencies": [
    "clsx",
    "tailwind-merge",
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/crypto24/crypto24.tsx",
      "content": "\"use client\";\n\nimport { ArrowUpRight, Clock, Vote } from \"lucide-react\";\n\nimport Link from \"next/link\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Proposal {\n  title: string;\n  description: string;\n  status: \"active\" | \"passed\" | \"rejected\" | \"pending\";\n  votesFor: number;\n  votesAgainst: number;\n  totalVotes: number;\n  quorum: number;\n  endTime: string;\n  proposer: string;\n  url: string;\n}\n\ninterface Crypto24Props {\n  badge?: string;\n  heading?: string;\n  description?: string;\n  proposals?: Proposal[];\n  labels?: {\n    active?: string;\n    passed?: string;\n    rejected?: string;\n    pending?: string;\n    for?: string;\n    against?: string;\n    quorum?: string;\n    left?: string;\n    proposedBy?: string;\n    votes?: string;\n  };\n  className?: string;\n}\n\nfunction StatusBadge({\n  status,\n  labels,\n}: {\n  status: Proposal[\"status\"];\n  labels: Crypto24Props[\"labels\"];\n}) {\n  const styles = {\n    active: \"bg-foreground/10 text-foreground\",\n    passed: \"bg-emerald-500/10 text-emerald-500\",\n    rejected: \"bg-rose-500/10 text-rose-500\",\n    pending: \"bg-muted text-muted-foreground\",\n  };\n\n  const statusLabels = {\n    active: labels?.active ?? \"Active\",\n    passed: labels?.passed ?? \"Passed\",\n    rejected: labels?.rejected ?? \"Rejected\",\n    pending: labels?.pending ?? \"Pending\",\n  };\n\n  return (\n    <span\n      className={cn(\n        \"rounded-full px-2.5 py-1 text-xs font-medium\",\n        styles[status]\n      )}\n    >\n      {statusLabels[status]}\n    </span>\n  );\n}\n\nfunction VoteBar({\n  votesFor,\n  votesAgainst,\n  quorum,\n  totalVotes,\n  labels,\n}: {\n  votesFor: number;\n  votesAgainst: number;\n  quorum: number;\n  totalVotes: number;\n  labels: Crypto24Props[\"labels\"];\n}) {\n  const total = votesFor + votesAgainst;\n  const forPercent = total > 0 ? (votesFor / total) * 100 : 50;\n  const quorumPercent = (totalVotes / quorum) * 100;\n\n  const forLabel = labels?.for ?? \"For\";\n  const againstLabel = labels?.against ?? \"Against\";\n  const quorumLabel = labels?.quorum ?? \"Quorum\";\n\n  return (\n    <div className=\"space-y-2\">\n      {/* Vote distribution */}\n      <div className=\"flex h-2 overflow-hidden rounded-full bg-muted\">\n        <div\n          className=\"bg-emerald-400/60 transition-all\"\n          style={{ width: `${forPercent}%` }}\n        />\n        <div\n          className=\"bg-rose-400/60 transition-all\"\n          style={{ width: `${100 - forPercent}%` }}\n        />\n      </div>\n\n      {/* Labels */}\n      <div className=\"flex justify-between text-xs\">\n        <span className=\"text-emerald-600 dark:text-emerald-400\">\n          {forLabel}: {forPercent.toFixed(1)}%\n        </span>\n        <span className=\"text-muted-foreground\">\n          {quorumLabel}: {quorumPercent.toFixed(0)}%\n        </span>\n        <span className=\"text-rose-600 dark:text-rose-400\">\n          {againstLabel}: {(100 - forPercent).toFixed(1)}%\n        </span>\n      </div>\n    </div>\n  );\n}\n\nfunction shortenAddress(address: string): string {\n  return `${address.slice(0, 6)}...${address.slice(-4)}`;\n}\n\nexport const crypto24Demo: Crypto24Props = {\n  badge: \"Governance\",\n  heading: \"Active Proposals\",\n  description:\n    \"Participate in protocol governance by voting on community proposals.\",\n  proposals: [\n    {\n      title: \"Increase staking rewards by 2%\",\n      description:\n        \"Proposal to increase the base staking APY from 8% to 10% to attract more long-term stakers.\",\n      status: \"active\",\n      votesFor: 2450000,\n      votesAgainst: 890000,\n      totalVotes: 3340000,\n      quorum: 4000000,\n      endTime: \"2 days\",\n      proposer: \"0x1234567890abcdef1234567890abcdef12345678\",\n      url: \"https://beste.co\",\n    },\n    {\n      title: \"Add new liquidity pool for ETH/USDC\",\n      description:\n        \"Create a new concentrated liquidity pool to improve trading efficiency.\",\n      status: \"active\",\n      votesFor: 1890000,\n      votesAgainst: 1650000,\n      totalVotes: 3540000,\n      quorum: 4000000,\n      endTime: \"5 days\",\n      proposer: \"0xabcdef1234567890abcdef1234567890abcdef12\",\n      url: \"https://beste.co\",\n    },\n    {\n      title: \"Treasury diversification strategy\",\n      description:\n        \"Allocate 20% of treasury to blue-chip DeFi protocols for yield.\",\n      status: \"passed\",\n      votesFor: 5200000,\n      votesAgainst: 1100000,\n      totalVotes: 6300000,\n      quorum: 4000000,\n      endTime: \"Ended\",\n      proposer: \"0x567890abcdef1234567890abcdef123456789012\",\n      url: \"https://beste.co\",\n    },\n    {\n      title: \"Reduce governance token inflation\",\n      description: \"Decrease annual token emission rate from 5% to 3%.\",\n      status: \"rejected\",\n      votesFor: 1200000,\n      votesAgainst: 3800000,\n      totalVotes: 5000000,\n      quorum: 4000000,\n      endTime: \"Ended\",\n      proposer: \"0x890abcdef1234567890abcdef12345678901234\",\n      url: \"https://beste.co\",\n    },\n  ],\n  labels: {\n    active: \"Active\",\n    passed: \"Passed\",\n    rejected: \"Rejected\",\n    pending: \"Pending\",\n    for: \"For\",\n    against: \"Against\",\n    quorum: \"Quorum\",\n    left: \"left\",\n    proposedBy: \"Proposed by\",\n    votes: \"votes\",\n  },\n};\n\nexport function Crypto24({\n  badge,\n  heading,\n  description,\n  proposals = [],\n  labels = {},\n  className,\n}: Crypto24Props) {\n  const {\n    left: leftLabel,\n    proposedBy: proposedByLabel,\n    votes: votesLabel,\n  } = labels;\n\n  if (proposals.length === 0) return null;\n\n  return (\n    <section className={cn(\"py-16 md:py-24 w-full\", className)}>\n      <div className=\"mx-auto max-w-2xl px-4\">\n        {/* Header */}\n        <div className=\"mb-12 text-center\">\n          <div className=\"mb-4 inline-flex items-center gap-2 rounded-full bg-muted px-4 py-2 text-sm font-medium text-foreground\">\n            <Vote className=\"size-4\" />\n            {badge}\n          </div>\n          <h2 className=\"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-4xl\">\n            {heading}\n          </h2>\n          <p className=\"mx-auto max-w-2xl text-muted-foreground\">\n            {description}\n          </p>\n        </div>\n\n        {/* Proposals List */}\n        <div className=\"space-y-4\">\n          {proposals.map((proposal, index) => (\n            <Link\n              key={index}\n              href={proposal.url}\n              className=\"group block rounded-xl border bg-card p-5 transition-all hover:border-foreground/20 hover:bg-muted/30\"\n            >\n              {/* Header */}\n              <div className=\"mb-3 flex items-start justify-between gap-4\">\n                <div className=\"flex-1\">\n                  <div className=\"mb-2 flex items-center gap-2\">\n                    <StatusBadge status={proposal.status} labels={labels} />\n                    {proposal.status === \"active\" && (\n                      <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n                        <Clock className=\"size-3\" />\n                        {proposal.endTime} {leftLabel}\n                      </span>\n                    )}\n                  </div>\n                  <h3 className=\"text-lg font-semibold text-foreground group-hover:underline\">\n                    {proposal.title}\n                  </h3>\n                </div>\n                <ArrowUpRight className=\"size-5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100\" />\n              </div>\n\n              {/* Description */}\n              <p className=\"mb-4 line-clamp-2 text-sm text-muted-foreground\">\n                {proposal.description}\n              </p>\n\n              {/* Vote Bar */}\n              <VoteBar\n                votesFor={proposal.votesFor}\n                votesAgainst={proposal.votesAgainst}\n                quorum={proposal.quorum}\n                totalVotes={proposal.totalVotes}\n                labels={labels}\n              />\n\n              {/* Footer */}\n              <div className=\"mt-4 flex items-center justify-between border-t pt-4 text-xs text-muted-foreground\">\n                <span>\n                  {proposedByLabel} {shortenAddress(proposal.proposer)}\n                </span>\n                <span>\n                  {(proposal.totalVotes / 1000000).toFixed(1)}M {votesLabel}\n                </span>\n              </div>\n            </Link>\n          ))}\n        </div>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/block/crypto24.tsx"
    }
  ],
  "type": "registry:block"
}