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