Portal/rsconcept/frontend/src/components/ui/DropdownCheckbox.tsx

22 lines
588 B
TypeScript
Raw Normal View History

2024-06-07 20:17:03 +03:00
import clsx from 'clsx';
import Checkbox, { CheckboxProps } from './Checkbox';
2024-06-07 20:17:03 +03:00
2024-10-30 21:35:43 +03:00
/** Animated {@link Checkbox} inside a {@link Dropdown} item. */
function DropdownCheckbox({ setValue, disabled, ...restProps }: CheckboxProps) {
2024-06-07 20:17:03 +03:00
return (
2024-12-12 13:17:24 +03:00
<div
2024-06-07 20:17:03 +03:00
className={clsx(
'px-3 py-1',
'text-left overflow-ellipsis whitespace-nowrap',
'disabled:clr-text-controls',
!!setValue && !disabled && 'clr-hover'
)}
>
<Checkbox tabIndex={-1} disabled={disabled} setValue={setValue} {...restProps} />
2024-12-12 13:17:24 +03:00
</div>
2024-06-07 20:17:03 +03:00
);
}
export default DropdownCheckbox;