perf(format): code format
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user