This commit is contained in:
2025-06-19 22:03:57 +08:00
parent 538dd3c81e
commit 69b8967014
19 changed files with 52 additions and 71 deletions

View File

@@ -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),
{

View File

@@ -3,7 +3,6 @@ import {
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,