ConceptPortal-public/rsconcept/frontend/src/components/Common/DropdownCheckbox.tsx

29 lines
696 B
TypeScript
Raw Normal View History

2023-09-02 01:11:27 +03:00
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} w-full whitespace-nowrap`}
2023-09-02 01:11:27 +03:00
>
<Checkbox
widthClass='w-full'
2023-09-02 01:11:27 +03:00
disabled={disabled}
onChange={onChange}
{...props}
/>
</div>
);
}
export default DropdownCheckbox;