"use client"; import { cn } from "@app/lib/cn"; import { RadioGroup, RadioGroupItem } from "./ui/radio-group"; import { useState } from "react"; interface StrategyOption { id: TValue; title: string; description: string; disabled?: boolean; } interface StrategySelectProps { options: ReadonlyArray>; defaultValue?: TValue; onChange?: (value: TValue) => void; cols?: number; } export function StrategySelect({ options, defaultValue, onChange, cols }: StrategySelectProps) { const [selected, setSelected] = useState(defaultValue); return ( { const typedValue = value as TValue; setSelected(typedValue); onChange?.(typedValue); }} className={`grid md:grid-cols-${cols ? cols : 1} gap-4`} > {options.map((option: StrategyOption) => ( ))} ); }