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

40 lines
776 B
TypeScript

import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch";
const WarningSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
className,
knobClassName,
disabled,
...props
}, ref ) => {
return (
<MattrixwvSwitch
{...props}
className={clsx(
"bg-neutral-mid",
className,
{
"data-checked:bg-warning": !disabled,
"data-checked:bg-warning-light/80": disabled
}
)}
knobClassName={clsx(
knobClassName,
{
"bg-white": !disabled,
"bg-neutral-light": disabled
}
)}
disabled={disabled}
ref={ref}
/>
);
});
WarningSwitch.displayName = "WarningSwitch";
export default WarningSwitch;