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