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