'use client' import type { ComponentProps, ReactNode } from 'react' import { Description, FieldError, Label, Checkbox as HeroCheckbox, Radio as HeroRadio, RadioGroup as HeroRadioGroup, Switch as HeroSwitch, } from '@heroui/react' import { cn } from '@/lib/cn' interface ControlClassNames { base?: string label?: string wrapper?: string } type CheckboxProps = Omit, 'children' | 'className' | 'onChange' | 'size'> & { children?: ReactNode className?: string classNames?: ControlClassNames color?: string isInvalid?: boolean size?: 'sm' | 'md' | 'lg' onValueChange?: (selected: boolean) => void } export function Checkbox({ children, className, classNames, color: _color, isInvalid, size, onValueChange, ...props }: CheckboxProps) { return ( {children} ) } type SwitchProps = Omit, 'children' | 'className' | 'onChange'> & { children?: ReactNode className?: string classNames?: ControlClassNames size?: 'sm' | 'md' | 'lg' onValueChange?: (selected: boolean) => void } export function Switch({ children, className, classNames, size, onValueChange, ...props }: SwitchProps) { return ( {children} ) } type RadioGroupProps = Omit, 'children' | 'className' | 'onChange' | 'orientation'> & { children?: ReactNode className?: string classNames?: ControlClassNames description?: ReactNode descriptionClassName?: string errorMessage?: ReactNode label?: ReactNode orientation?: 'horizontal' | 'vertical' size?: 'sm' | 'md' | 'lg' onValueChange?: (value: string) => void } export function RadioGroup({ children, className, classNames, description, descriptionClassName, errorMessage, isInvalid, label, orientation = 'vertical', size: _size, onValueChange, ...props }: RadioGroupProps) { return ( {label ? : null}
{children}
{description ? {description} : null} {isInvalid && errorMessage ? {errorMessage} : null}
) } type RadioProps = Omit, 'children' | 'className'> & { children?: ReactNode className?: string classNames?: ControlClassNames size?: 'sm' | 'md' | 'lg' } export function Radio({ children, className, classNames, size: _size, ...props }: RadioProps) { return ( {children} ) }