2023-09-02 01:11:27 +03:00
|
|
|
import Checkbox from './Checkbox';
|
|
|
|
|
|
|
|
interface DropdownCheckboxProps {
|
2023-09-07 16:30:43 +03:00
|
|
|
value: boolean
|
2023-09-02 01:11:27 +03:00
|
|
|
label?: string
|
|
|
|
tooltip?: string
|
|
|
|
disabled?: boolean
|
2023-09-07 16:30:43 +03:00
|
|
|
setValue?: (newValue: boolean) => void
|
2023-09-02 01:11:27 +03:00
|
|
|
}
|
|
|
|
|
2023-09-07 16:30:43 +03:00
|
|
|
function DropdownCheckbox({ tooltip, setValue, disabled, ...props }: DropdownCheckboxProps) {
|
|
|
|
const behavior = (setValue && !disabled ? 'clr-hover' : '');
|
2023-09-02 01:11:27 +03:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
title={tooltip}
|
2023-09-03 18:26:50 +03:00
|
|
|
className={`px-4 py-1 text-left overflow-ellipsis ${behavior} w-full whitespace-nowrap`}
|
2023-09-02 01:11:27 +03:00
|
|
|
>
|
|
|
|
<Checkbox
|
2023-09-15 23:29:52 +03:00
|
|
|
dimensions='w-full'
|
2023-09-02 01:11:27 +03:00
|
|
|
disabled={disabled}
|
2023-09-07 16:30:43 +03:00
|
|
|
setValue={setValue}
|
2023-09-02 01:11:27 +03:00
|
|
|
{...props}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DropdownCheckbox;
|