mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-27 13:30:36 +03:00
28 lines
653 B
TypeScript
28 lines
653 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, ...restProps }: 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
|
|
dimensions='w-full'
|
|
disabled={disabled}
|
|
setValue={setValue}
|
|
{...restProps}
|
|
/>
|
|
</div>);
|
|
}
|
|
|
|
export default DropdownCheckbox;
|