implemented initial eslintFixes

This commit is contained in:
PxlLoewe
2025-07-09 01:06:54 -07:00
parent f793f2623b
commit 98ed0cb5ca
20 changed files with 309 additions and 111 deletions

View File

@@ -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>
);