diff --git a/src/components/checkbox-option-group.tsx b/src/components/checkbox-option-group.tsx index cb09ca5..c4464d0 100644 --- a/src/components/checkbox-option-group.tsx +++ b/src/components/checkbox-option-group.tsx @@ -1,58 +1,46 @@ import React from "react"; -export interface CheckboxOption { +export interface RadioOption { label: string; value: T; disabled?: boolean; } -interface CheckboxOptionGroupProps { +interface RadioOptionGroupProps { name: string; - options: CheckboxOption[]; - selectedValues: T[]; - onChange: (value: T, checked: boolean) => void; - maxSelected?: number; + options: RadioOption[]; + selectedValue?: T; + onChange: (option: RadioOption) => void; disabled?: boolean; className?: string; } -export default function CheckboxOptionGroup({ +export default function RadioOptionGroup({ name, options, - selectedValues, + selectedValue, onChange, - maxSelected, disabled = false, className = "", -}: CheckboxOptionGroupProps) { - const isSelected = (value: T) => selectedValues.includes(value); - +}: RadioOptionGroupProps) { return (
- {options.map((option, index) => { - const checked = isSelected(option.value); - const limitReached = - maxSelected !== undefined && - selectedValues.length >= maxSelected && - !checked; - - return ( - - ); - })} + {options.map((option, index) => ( + + ))}
); }