引入 husky,并全局重新格式化
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
import { ReactNode } from 'react'
|
||||
import { Metadata } from 'next'
|
||||
import {ReactNode} from 'react'
|
||||
import {Metadata} from 'next'
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return {
|
||||
@@ -9,9 +8,9 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
}
|
||||
|
||||
export type WhitelistLayoutProps = {
|
||||
children: ReactNode
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
export default async function WhitelistLayout(props: WhitelistLayoutProps) {
|
||||
return props.children
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
}
|
||||
else {
|
||||
const newSelection = new Set<number>()
|
||||
data.list.forEach(item => {
|
||||
data.list.forEach((item) => {
|
||||
newSelection.add(item.id)
|
||||
})
|
||||
setSelection(newSelection)
|
||||
@@ -231,8 +231,8 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
添加白名单
|
||||
</Button>
|
||||
<Button
|
||||
theme={`fail`}
|
||||
className={`ml-2`}
|
||||
theme="fail"
|
||||
className="ml-2"
|
||||
disabled={selection.size === 0 || wait}
|
||||
onClick={() => confirmRemove()}>
|
||||
<Trash2/>
|
||||
@@ -267,7 +267,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
cell: ({row}) => (
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button
|
||||
className={`h-9 w-9`}
|
||||
className="h-9 w-9"
|
||||
theme="outline"
|
||||
onClick={() => openDialog('edit', row.original)}
|
||||
disabled={wait}
|
||||
@@ -275,9 +275,9 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
<Edit className="w-4 h-4"/>
|
||||
</Button>
|
||||
<Button
|
||||
className={`h-9 w-9`}
|
||||
className="h-9 w-9"
|
||||
onClick={() => confirmRemove(row.original.id)}
|
||||
theme={`fail`}
|
||||
theme="fail"
|
||||
disabled={wait}
|
||||
>
|
||||
<Trash2 className="w-4 h-4"/>
|
||||
@@ -297,22 +297,22 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
<Form<SchemaType>
|
||||
className={`flex flex-col gap-4 py-4`}
|
||||
className="flex flex-col gap-4 py-4"
|
||||
form={form}
|
||||
onSubmit={onSubmit}>
|
||||
<FormField name={`host`} label={`IP地址`}>
|
||||
<FormField name="host" label="IP地址">
|
||||
{({id, field}) => (
|
||||
<Input {...field} id={id} placeholder="输入IP地址"/>
|
||||
)}
|
||||
</FormField>
|
||||
<FormField name={`remark`} label={`备注`}>
|
||||
<FormField name="remark" label="备注">
|
||||
{({id, field}) => (
|
||||
<Textarea {...field} id={id} placeholder="输入备注信息(可选)" disabled={wait}/>
|
||||
)}
|
||||
</FormField>
|
||||
<DialogFooter className={`gap-4 mt-4`}>
|
||||
<Button theme={`outline`} type="button" onClick={() => toggleDialog(false)} disabled={wait}>取消</Button>
|
||||
<Button type={`submit`} disabled={wait}>
|
||||
<DialogFooter className="gap-4 mt-4">
|
||||
<Button theme="outline" type="button" onClick={() => toggleDialog(false)} disabled={wait}>取消</Button>
|
||||
<Button type="submit" disabled={wait}>
|
||||
{wait && <Loader2 className="w-4 h-4 mr-2 animate-spin"/>}
|
||||
保存
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user