perf(format): code format

This commit is contained in:
zhangheng
2026-02-27 10:21:43 +08:00
parent 6cb8f98004
commit e3ca3e9c31
15 changed files with 257 additions and 142 deletions

View File

@@ -19,12 +19,12 @@ interface ComponentProps {
export default function CreateModal({ opened, onCloseAction }: ComponentProps) {
const storeUserOpts = useAllUserStore((s) => s.userOpts)
const [groupOpts, setGroupOpts] = useState<Array<{ label: string; value: string }>>(
[]
)
const [userOpts, setUserOpts] = useState<Array<{ label: string; value: string }>>(
[]
)
const [groupOpts, setGroupOpts] = useState<
Array<{ label: string; value: string }>
>([])
const [userOpts, setUserOpts] = useState<
Array<{ label: string; value: string }>
>([])
const [submitting, setSubmitting] = useState(false)
const finalUserOpts = useMemo(() => {
@@ -51,7 +51,9 @@ export default function CreateModal({ opened, onCloseAction }: ComponentProps) {
getUserAll(),
])
setGroupOpts(groupRes ?? [])
setUserOpts((userRes ?? []).map((u) => ({ label: u.label, value: String(u.value) })))
setUserOpts(
(userRes ?? []).map((u) => ({ label: u.label, value: String(u.value) }))
)
}
queueMicrotask(run)
}, [opened])
@@ -125,11 +127,7 @@ export default function CreateModal({ opened, onCloseAction }: ComponentProps) {
onClick={() => onCloseAction()}>
</Button>
<Button
type="submit"
size="xs"
radius="xs"
loading={submitting}>
<Button type="submit" size="xs" radius="xs" loading={submitting}>
</Button>
</Group>

View File

@@ -15,7 +15,12 @@ import {
TextInput,
} from "@mantine/core"
import { notifications } from "@mantine/notifications"
import { IconPlus, IconRefresh, IconSearch, IconUserCircle } from "@tabler/icons-react"
import {
IconPlus,
IconRefresh,
IconSearch,
IconUserCircle,
} from "@tabler/icons-react"
import { useCallback, useEffect, useMemo, useState } from "react"
import CreateModal from "./components/CreateModal"