添加编辑资源加载态
This commit is contained in:
@@ -21,6 +21,7 @@ import { Resource } from "@/lib/types/resource"
|
|||||||
import { AdminApi } from "@/lib/api"
|
import { AdminApi } from "@/lib/api"
|
||||||
import useSWR from "swr"
|
import useSWR from "swr"
|
||||||
import { ApiError } from "next/dist/server/api-utils"
|
import { ApiError } from "next/dist/server/api-utils"
|
||||||
|
import { Skeleton } from "@/components/ui/skeleton"
|
||||||
interface ResourceEditProps {
|
interface ResourceEditProps {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
id: string;
|
id: string;
|
||||||
@@ -68,6 +69,14 @@ export default function ResourceEdit({ children, id, onRefresh }: ResourceEditPr
|
|||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>编辑资源</DialogTitle>
|
<DialogTitle>编辑资源</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
{
|
||||||
|
isLoading && (
|
||||||
|
[...Array(5)].map((_, index) => (
|
||||||
|
<Skeleton className="w-full h-14 rounded" key={index} />
|
||||||
|
))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
{resource && (
|
{resource && (
|
||||||
<>
|
<>
|
||||||
<div className="grid gap-4 py-4">
|
<div className="grid gap-4 py-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user