Files
MattrixwvReactComponents/lib/component/input/switch/SuccessDangerSwitch.tsx
2025-07-19 22:48:01 -04:00

31 lines
585 B
TypeScript

import type { MattrixwvSwitchProps } from "$/types/Input";
import clsx from "clsx";
import MattrixwvSwitch from "./MattrixwvSwitch";
export default function SuccessDangerSwitch({
className,
disabled,
...props
}: MattrixwvSwitchProps){
return (
<MattrixwvSwitch
{...props}
className={clsx(
className,
{
"bg-red-600 data-checked:bg-green-600": !disabled,
"bg-red-400/80 data-checked:bg-green-400/80": disabled
}
)}
knobClassName={clsx(
{
"bg-white": !disabled,
"bg-gray-200": disabled
}
)}
disabled={disabled}
/>
);
}