11import {
2- ArrowUpRightIcon ,
3- AxeIcon ,
4- CommandIcon ,
5- NetworkIcon ,
6- ServerIcon ,
7- ShieldOffIcon ,
8- SwordIcon ,
9- WaypointsIcon ,
10- ZapIcon ,
2+ ArrowUpRightIcon ,
3+ AxeIcon ,
4+ CommandIcon ,
5+ NetworkIcon ,
6+ ServerIcon ,
7+ ShieldOffIcon ,
8+ SwordIcon ,
9+ WaypointsIcon ,
10+ ZapIcon ,
1111} from "lucide-react" ;
12- import { type JSX , useCallback , useEffect , useId , useState } from "react" ;
13- import { FormProvider , type UseFormReturn } from "react-hook-form" ;
14- import { useTranslation } from "react-i18next" ;
15- import { AntSwordTabContent } from "@/components/memshell/tabs/antsword-tab" ;
16- import { BehinderTabContent } from "@/components/memshell/tabs/behinder-tab" ;
17- import { CommandTabContent } from "@/components/memshell/tabs/command-tab" ;
12+ import { type JSX , useCallback , useEffect , useState } from "react" ;
13+ import { FormProvider , type UseFormReturn } from "react-hook-form" ;
14+ import { useTranslation } from "react-i18next" ;
15+ import { AntSwordTabContent } from "@/components/memshell/tabs/antsword-tab" ;
16+ import { BehinderTabContent } from "@/components/memshell/tabs/behinder-tab" ;
17+ import { CommandTabContent } from "@/components/memshell/tabs/command-tab" ;
1818import CustomTabContent from "@/components/memshell/tabs/custom-tab" ;
19- import { GodzillaTabContent } from "@/components/memshell/tabs/godzilla-tab" ;
20- import { NeoRegTabContent } from "@/components/memshell/tabs/neoreg-tab" ;
21- import { Suo5TabContent } from "@/components/memshell/tabs/suo5-tab" ;
22- import { Card , CardContent , CardHeader , CardTitle } from "@/components/ui/card.tsx" ;
19+ import { GodzillaTabContent } from "@/components/memshell/tabs/godzilla-tab" ;
20+ import { NeoRegTabContent } from "@/components/memshell/tabs/neoreg-tab" ;
21+ import { Suo5TabContent } from "@/components/memshell/tabs/suo5-tab" ;
2322import {
24- FormControl ,
25- FormDescription ,
26- FormField ,
27- FormFieldItem ,
28- FormFieldLabel ,
29- FormItem ,
30- FormLabel ,
31- FormMessage ,
23+ Card ,
24+ CardContent ,
25+ CardHeader ,
26+ CardTitle ,
27+ } from "@/components/ui/card.tsx" ;
28+ import {
29+ FormControl ,
30+ FormDescription ,
31+ FormField ,
32+ FormFieldItem ,
33+ FormFieldLabel ,
34+ FormItem ,
35+ FormLabel ,
36+ FormMessage ,
3237} from "@/components/ui/form.tsx" ;
33- import { Label } from "@/components/ui/label.tsx" ;
34- import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@/components/ui/select.tsx" ;
35- import { Switch } from "@/components/ui/switch.tsx" ;
36- import { Tabs , TabsList , TabsTrigger } from "@/components/ui/tabs" ;
37- import { type MainConfig , type ServerConfig , ShellToolType } from "@/types/memshell" ;
38- import type { MemShellFormSchema } from "@/types/schema.ts" ;
38+ import { Label } from "@/components/ui/label.tsx" ;
39+ import {
40+ Select ,
41+ SelectContent ,
42+ SelectItem ,
43+ SelectTrigger ,
44+ SelectValue ,
45+ } from "@/components/ui/select.tsx" ;
46+ import { Switch } from "@/components/ui/switch.tsx" ;
47+ import { Tabs , TabsList , TabsTrigger } from "@/components/ui/tabs" ;
48+ import {
49+ type MainConfig ,
50+ type ServerConfig ,
51+ ShellToolType ,
52+ } from "@/types/memshell" ;
53+ import type { MemShellFormSchema } from "@/types/schema.ts" ;
3954
4055const shellToolIcons : Record < ShellToolType , JSX . Element > = {
4156 [ ShellToolType . Behinder ] : < ShieldOffIcon className = "h-4 w-4" /> ,
@@ -79,7 +94,9 @@ export default function MainConfigCard({
7994 const shellTool = form . watch ( "shellTool" ) ;
8095 const { t } = useTranslation ( ) ;
8196
82- const [ serverVersionOptions , setServerVersionOptions ] = useState ( defaultServerVersionOptions ) ;
97+ const [ serverVersionOptions , setServerVersionOptions ] = useState (
98+ defaultServerVersionOptions ,
99+ ) ;
83100
84101 // 处理一下 shellTypes 由于 server 或 shellTool 变更时无法正常为 form.shellType 赋值的问题
85102 useEffect ( ( ) => {
@@ -95,7 +112,10 @@ export default function MainConfigCard({
95112 setShellToolMap ( newShellToolMap ) ;
96113
97114 const newShellTools = Object . keys ( newShellToolMap ) ;
98- setShellTools ( [ ...newShellTools . map ( ( tool ) => tool as ShellToolType ) , ShellToolType . Custom ] ) ;
115+ setShellTools ( [
116+ ...newShellTools . map ( ( tool ) => tool as ShellToolType ) ,
117+ ShellToolType . Custom ,
118+ ] ) ;
99119
100120 const currentShellTool = form . getValues ( "shellTool" ) ;
101121
@@ -233,10 +253,6 @@ export default function MainConfigCard({
233253 [ form , servers , shellToolMap ] ,
234254 ) ;
235255
236- const debugId = useId ( ) ;
237- const bypassId = useId ( ) ;
238- const shrinkId = useId ( ) ;
239-
240256 return (
241257 < FormProvider { ...form } >
242258 < Card >
0 commit comments