Update switches
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import type { MattrixwvSwitchProps } from "$/types/InputTypes";
|
||||
import { Field, Label, Switch } from "@headlessui/react";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import { Fragment } from "react/jsx-runtime";
|
||||
|
||||
|
||||
const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
|
||||
export default function MattrixwvSwitch({
|
||||
id,
|
||||
className,
|
||||
knobClassName,
|
||||
@@ -20,7 +19,7 @@ const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
|
||||
children,
|
||||
offText,
|
||||
onText
|
||||
}, ref ) => {
|
||||
}: Readonly<MattrixwvSwitchProps>){
|
||||
return (
|
||||
<Field as={Fragment}>
|
||||
<Switch
|
||||
@@ -54,7 +53,6 @@ const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
|
||||
checked={checked}
|
||||
onChange={onChange}
|
||||
disabled={disabled}
|
||||
ref={ref}
|
||||
>
|
||||
{
|
||||
offText &&
|
||||
@@ -107,8 +105,4 @@ const MattrixwvSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
|
||||
</Label>
|
||||
</Field>
|
||||
);
|
||||
});
|
||||
|
||||
MattrixwvSwitch.displayName = "MattrixwvSwitch";
|
||||
|
||||
export default MattrixwvSwitch;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user