lint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import React, { use, useState } from "react"
|
||||
import React, { useState } from "react"
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -13,25 +13,9 @@ import { Input } from "@/components/ui/input"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { toast } from "sonner"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
import { Plus } from "lucide-react"
|
||||
import { Resource } from "@/lib/types/resource"
|
||||
import { AdminApi } from "@/lib/api"
|
||||
import useSWR from "swr"
|
||||
import { ApiError } from "next/dist/server/api-utils"
|
||||
import { Skeleton } from "@/components/ui/skeleton"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
|
||||
|
||||
interface BlogEditProps {
|
||||
id: string;
|
||||
@@ -41,7 +25,7 @@ interface BlogEditProps {
|
||||
|
||||
export default function BlogEdit({ id, children, onRefresh }: BlogEditProps) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const { data: blog, error, isLoading, mutate } = useSWR(
|
||||
const { data: blog, mutate } = useSWR(
|
||||
open ? `/api/admin/web/blog/${id}` : null,
|
||||
() => AdminApi.web.blog.get(id),
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
TableBody,
|
||||
TableCaption,
|
||||
TableCell,
|
||||
TableFooter,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
|
||||
@@ -6,7 +6,7 @@ import AddBlog from "./components/AddBlog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
export default function Page() {
|
||||
const { blogs, error, isLoading, refresh } = useBlogList();
|
||||
const { blogs, refresh } = useBlogList();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -153,7 +153,7 @@ export default function AddResource({ children, refresh }: AddResourceProps) {
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button type="submit" onClick={handleSubmit}>保存</Button>
|
||||
<Button type="submit" onClick={handleSubmit} disabled={loading}>保存</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -43,7 +43,7 @@ interface ResourceEditProps {
|
||||
export default function ResourceEdit({ children, id, onRefresh }: ResourceEditProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const { data: resource, error, isLoading, mutate } = useSWR<Resource>(
|
||||
const { data: resource, isLoading, mutate } = useSWR<Resource>(
|
||||
open ? [`/api/admin/web/resource/${id}`] : null,
|
||||
() => AdminApi.web.resource.get(id),
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Button } from "@/components/ui/button";
|
||||
import AddResource from "./components/AddResource";
|
||||
|
||||
export default function Page() {
|
||||
const { resources, error, isLoading, mutate, refresh } = useResourceList();
|
||||
const { resources, refresh } = useResourceList();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user