Update switches

This commit is contained in:
2026-02-14 17:04:16 -05:00
parent 1743ed6ce4
commit 31c44d3d92
13 changed files with 39 additions and 117 deletions

View File

@@ -1,9 +1,8 @@
import type { MattrixwvButtonSwitchProps } from "$/types/InputTypes";
import { Switch } from "@headlessui/react";
import { forwardRef } from "react";
const ButtonSwitch = forwardRef<HTMLButtonElement, MattrixwvButtonSwitchProps>(({
export default function ButtonSwitch({
id,
className,
name,
@@ -14,7 +13,7 @@ const ButtonSwitch = forwardRef<HTMLButtonElement, MattrixwvButtonSwitchProps>((
disabled,
onNode,
offNode
}, ref ) => {
}: Readonly<MattrixwvButtonSwitchProps>){
return (
<Switch
id={id}
@@ -25,7 +24,6 @@ const ButtonSwitch = forwardRef<HTMLButtonElement, MattrixwvButtonSwitchProps>((
checked={checked}
onChange={onChange}
disabled={disabled}
ref={ref}
>
{({ checked }) => (
<>
@@ -34,8 +32,4 @@ const ButtonSwitch = forwardRef<HTMLButtonElement, MattrixwvButtonSwitchProps>((
)}
</Switch>
);
});
ButtonSwitch.displayName = "ButtonSwitch";
export default ButtonSwitch;
}