Update + Delete articles
This commit is contained in:
27
frontend/app/(auth)/dashboard/blogs/[uuid]/page.tsx
Normal file
27
frontend/app/(auth)/dashboard/blogs/[uuid]/page.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
"use client";
|
||||
|
||||
import { useApi } from "@/hooks/use-api";
|
||||
import { Blog } from "@/types/types";
|
||||
import { Loader2 } from "lucide-react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
const BlogEditor = dynamic(
|
||||
() => import("@/components/article/edit").then((mod) => mod.default),
|
||||
{
|
||||
ssr: false,
|
||||
loading: () => <Loader2 className="animate-spin" />,
|
||||
},
|
||||
);
|
||||
|
||||
export default function Page() {
|
||||
const params = useParams<{ uuid: string }>();
|
||||
const {
|
||||
data: blog,
|
||||
error,
|
||||
mutate,
|
||||
success,
|
||||
isLoading,
|
||||
} = useApi<Blog>(`/blogs/${params.uuid}`, {}, false, false);
|
||||
return <BlogEditor blog={blog} />;
|
||||
}
|
||||
Reference in New Issue
Block a user