Files
MattrixwvReactComponents/lib/component/input/switch/PrimarySwitch.tsx

34 lines
611 B
TypeScript

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