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

31 lines
634 B
TypeScript

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