This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import RenderArticle from "@/components/article/render-article";
|
||||
import BreadNavigator from "@/components/bread-navigator";
|
||||
import RenderContent from "@/components/editor/render-content";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { appRoutes } from "@/config";
|
||||
import { hasPermission, Role } from "@/lib/validation/permissions";
|
||||
@@ -21,8 +22,9 @@ async function Page({ params }: { params: Promise<{ slug: string }> }) {
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<div className="w-full">
|
||||
<div className="flex w-full items-center gap-4">
|
||||
<BreadNavigator
|
||||
className="w-full"
|
||||
links={[
|
||||
...(article?.category
|
||||
? [
|
||||
@@ -38,7 +40,14 @@ async function Page({ params }: { params: Promise<{ slug: string }> }) {
|
||||
/>
|
||||
</div>
|
||||
{isEditor && (
|
||||
<div className="flex w-full justify-end space-x-2">
|
||||
<div className="flex w-full items-center justify-end space-x-2">
|
||||
<Badge
|
||||
className="size-max"
|
||||
variant={article.published ? "outline" : "destructive"}
|
||||
>
|
||||
{article.published ? "Veröffentlicht" : "Draft"}
|
||||
</Badge>
|
||||
|
||||
<Button asChild variant={"outline"}>
|
||||
<Link href={appRoutes.editArticle(article.slug)}>
|
||||
<Edit className="size-4" />
|
||||
@@ -52,10 +61,7 @@ async function Page({ params }: { params: Promise<{ slug: string }> }) {
|
||||
)}
|
||||
</div>
|
||||
<h1 className="text-4xl font-bold">{article.title}</h1>
|
||||
|
||||
{article?.content?.length ? (
|
||||
<RenderArticle content={article.content} />
|
||||
) : null}
|
||||
{article.content && <RenderContent content={article.content} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user