mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-27 13:30:36 +03:00
29 lines
670 B
TypeScript
29 lines
670 B
TypeScript
import Checkbox from './Checkbox';
|
|
|
|
interface DropdownCheckboxProps {
|
|
value: boolean
|
|
label?: string
|
|
tooltip?: string
|
|
disabled?: boolean
|
|
setValue?: (newValue: boolean) => void
|
|
}
|
|
|
|
function DropdownCheckbox({ tooltip, setValue, disabled, ...props }: DropdownCheckboxProps) {
|
|
const behavior = (setValue && !disabled ? 'clr-hover' : '');
|
|
return (
|
|
<div
|
|
title={tooltip}
|
|
className={`px-4 py-1 text-left overflow-ellipsis ${behavior} w-full whitespace-nowrap`}
|
|
>
|
|
<Checkbox
|
|
widthClass='w-full'
|
|
disabled={disabled}
|
|
setValue={setValue}
|
|
{...props}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default DropdownCheckbox;
|