Update switches
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user