{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "betting-panel-02", "title": "Betting Panel 02", "description": "A slider-based betting panel with a gradient risk slider for visual feedback on the chosen risk level.", "dependencies": [ "lucide-react" ], "registryDependencies": [ "button", "card", "slider", "tabs" ], "files": [ { "path": "registry/default/blocks/betting-panel-02/components/betting-panel.tsx", "content": "\"use client\";\n\nimport { Wallet } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport {\n Slider,\n SliderControl,\n SliderIndicator,\n SliderThumb,\n SliderTrack,\n} from \"@/components/ui/slider\";\nimport { Tabs, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\n\nconst BALANCE = 1000;\n\nfunction getRiskInfo(value: number) {\n if (value < 33) {\n return { label: \"Low\", color: \"text-emerald-500\" };\n }\n if (value < 66) {\n return { label: \"Medium\", color: \"text-amber-500\" };\n }\n return { label: \"High\", color: \"text-red-500\" };\n}\n\nexport function BettingPanel({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n const [betAmount, setBetAmount] = useState(1);\n const [risk, setRisk] = useState(50);\n const [rows, setRows] = useState(12);\n\n const riskInfo = getRiskInfo(risk);\n\n return (\n
\n \n \n \n \n \n Manual\n \n \n Auto\n \n \n \n\n
\n
\n
\n \n Balance\n
\n \n ${BALANCE.toFixed(2)}\n \n
\n\n
\n
\n \n Bet Amount\n \n \n ${betAmount.toFixed(2)}\n \n
\n \n setBetAmount(typeof v === \"number\" ? v : v[0])\n }\n step={0.01}\n value={betAmount}\n >\n \n \n \n \n \n \n \n
\n $0.01\n Max: ${BALANCE.toFixed(2)}\n
\n
\n\n
\n
\n Risk\n \n {riskInfo.label}\n \n
\n setRisk(typeof v === \"number\" ? v : v[0])}\n step={1}\n value={risk}\n >\n \n \n \n \n \n \n \n
\n\n
\n
\n Rows\n \n {rows}\n \n
\n setRows(typeof v === \"number\" ? v : v[0])}\n step={1}\n value={rows}\n >\n \n \n \n \n \n \n \n
\n 8\n 16\n
\n
\n\n \n
\n
\n
\n
\n );\n}\n\nexport default function BettingPanel02() {\n return (\n
\n
\n \n
\n
\n );\n}\n", "type": "registry:component" } ], "categories": [ "betting" ], "type": "registry:block" }