Files
MattrixwvReactComponents/lib/component/input/checkbox/WarningCheckbox.tsx

31 lines
654 B
TypeScript

import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox";
const WarningCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className,
showBox = true,
...props
}, ref) => {
return (
<MattrixwvCheckbox
className={clsx(
className,
{
"group-data-checked:bg-warning group-data-checked:stroke-white": showBox,
"group-data-checked:stroke-warning": !showBox
}
)}
showBox={showBox}
ref={ref}
{...props}
/>
);
});
WarningCheckbox.displayName = "WarningCheckbox";
export default WarningCheckbox;