import classNames from 'classnames'; import type { ReactNode } from 'react'; import { Icon } from './Icon'; import { HStack } from './Stacks'; export interface CheckboxProps { checked: boolean | 'indeterminate'; title: ReactNode; onChange: (checked: boolean) => void; className?: string; disabled?: boolean; inputWrapperClassName?: string; hideLabel?: boolean; } export function Checkbox({ checked, onChange, className, inputWrapperClassName, disabled, title, hideLabel, }: CheckboxProps) { return (
onChange(checked === 'indeterminate' ? true : !checked)} />
{!hideLabel && title}
); }