trucs inutilesé

This commit is contained in:
gom-by
2025-01-17 15:38:36 +01:00
parent 89f44f4469
commit 9d9b5a5145
13 changed files with 1119 additions and 51 deletions

View File

@@ -0,0 +1,42 @@
"use server";
import BlogItem, { BlogItemParams } from "@/components/blogItem";
import { Blog } from "@/types/types";
export default async function HistoryDetails({
params,
}: {
params: Promise<{ blog_id: string }>;
}) {
const { blog_id } = await params;
let blog = {}
try {
const res = await fetch('http://localhost:3001/blogs/' + blog_id, {method: "GET"})
blog = await res.json()
console.log(blog as Blog)
} catch(e) {
console.log(e);
}
if(blog == null) {
return(
<>
Error
</>
)
}
const blog_item_params: BlogItemParams = {
title_style:
"py-12 mb-3 text-pretty text-xl font-semibold md:mb-4 md:text-4xl lg:mb-6 lg:max-w-3xl lg:text-3xl",
subtitle_style:
"py-12 mb-3 text-pretty text-xl font-semibold md:mb-4 md:text-4xl lg:mb-6 lg:max-w-3xl lg:text-3xl",
p_style:
"blog-paragraph mb-5 text-muted-foreground md:text-base lg:max-w-2xl lg:text-lg",
default_img:
"https://shadcnblocks.com/images/block/placeholder-dark-1.svg",
blog: blog as Blog,
};
return <BlogItem params={blog_item_params} />;
}

View File

@@ -0,0 +1,9 @@
import Blog from "@/components/blog";
export default function History() {
return (
<div className="flex flex-col">
<Blog />
</div>
);
}