mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-24 16:01:52 +08:00
style: fmt code
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user