mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-07 14:13:58 -05:00
31 lines
585 B
TypeScript
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}
|
|
/>
|
|
);
|
|
}
|