style: fmt code

This commit is contained in:
ReaJason
2026-04-26 21:33:15 +08:00
parent d10323a054
commit ee560ff7ee
150 changed files with 948 additions and 1522 deletions
+5 -19
View File
@@ -1,23 +1,13 @@
import { InfoIcon } from "lucide-react";
import { memo } from "react";
import {
type Control,
Controller,
type FieldValues,
type Path,
} from "react-hook-form";
import { type Control, Controller, type FieldValues, type Path } from "react-hook-form";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
// Hoisted static JSX to avoid recreation on each render
const infoIcon = (
<InfoIcon className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
);
const infoIcon = <InfoIcon className="h-3.5 w-3.5 cursor-help text-muted-foreground" />;
interface SwitchFieldProps<T extends FieldValues> {
readonly name: Path<T>;
@@ -38,11 +28,7 @@ function SwitchFieldInner<T extends FieldValues>({
name={name}
render={({ field }) => (
<div className="flex items-center gap-2">
<Switch
id={name}
checked={field.value}
onCheckedChange={field.onChange}
/>
<Switch id={name} checked={field.value} onCheckedChange={field.onChange} />
<Label htmlFor={name}>{label}</Label>
<Tooltip>
<TooltipTrigger>{infoIcon}</TooltipTrigger>