import clsx from 'clsx'; import { PropsWithChildren } from 'react'; import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren'; import './BoxSelectorItem.css'; import { BoxSelectorOption } from './types'; interface Props { radioName: string; option: BoxSelectorOption; onChange?(value: T): void; selectedValue: T; disabled?: boolean; tooltip?: string; className?: string; type?: 'radio' | 'checkbox'; } export function BoxOption({ radioName, option, onChange = () => {}, selectedValue, disabled, tooltip, className, type = 'radio', children, }: PropsWithChildren>) { const BoxOption = (
onChange(option.value)} />
); if (tooltip) { return ( {BoxOption} ); } return BoxOption; }