implemented initial eslintFixes
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { FieldValues, Path, RegisterOptions, UseFormReturn } from "react-hook-form";
|
||||
import { cn } from "@repo/shared-components";
|
||||
|
||||
interface InputProps<T extends FieldValues>
|
||||
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "form"> {
|
||||
name: Path<T>;
|
||||
form: UseFormReturn<T>;
|
||||
form: UseFormReturn<any>;
|
||||
formOptions?: RegisterOptions<T>;
|
||||
label?: string;
|
||||
}
|
||||
@@ -13,7 +14,6 @@ export const Switch = <T extends FieldValues>({
|
||||
name,
|
||||
label = name,
|
||||
form,
|
||||
formOptions,
|
||||
className,
|
||||
...inputProps
|
||||
}: InputProps<T>) => {
|
||||
@@ -21,7 +21,12 @@ export const Switch = <T extends FieldValues>({
|
||||
<div className="form-control ">
|
||||
<label className="label cursor-pointer w-full">
|
||||
<span className={cn("label-text text-left w-full", className)}>{label}</span>
|
||||
<input type="checkbox" className={cn("toggle", className)} {...form.register(name)} />
|
||||
<input
|
||||
type="checkbox"
|
||||
className={cn("toggle", className)}
|
||||
{...form.register(name)}
|
||||
{...inputProps}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user