From 9810b08dbe56f840641e05e4546b1815b8a30832 Mon Sep 17 00:00:00 2001 From: naufalnrsmitter20 Date: Sun, 11 May 2025 20:05:09 +0700 Subject: [PATCH] feat: add NewsFigureOrganization component for displaying organization news --- .../[slug]/_components/parts/RelatedNews.tsx | 6 +- src/app/_components/global/NewsFigure.tsx | 55 +++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/app/(main)/organisasi/[period]/[slug]/_components/parts/RelatedNews.tsx b/src/app/(main)/organisasi/[period]/[slug]/_components/parts/RelatedNews.tsx index 909fdd7..952f7ed 100644 --- a/src/app/(main)/organisasi/[period]/[slug]/_components/parts/RelatedNews.tsx +++ b/src/app/(main)/organisasi/[period]/[slug]/_components/parts/RelatedNews.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; -import { NewsFigure } from "@/app/_components/global/NewsFigure"; +import { NewsFigureOrganization } from "@/app/_components/global/NewsFigure"; import { UnderlinedTitle, P } from "@/app/_components/global/Text"; import { SectionWrapper } from "@/app/_components/global/Wrapper"; import ArrowRight from "@/app/_components/icons/ArrowRight"; @@ -32,7 +32,9 @@ export default function RelatedNews({
{data.length !== 0 ? ( - data.map((post) => ) + data.map((post) => ( + + )) ) : (

Belum ada berita apa-apa, nih...

)} diff --git a/src/app/_components/global/NewsFigure.tsx b/src/app/_components/global/NewsFigure.tsx index f469359..e7766c3 100644 --- a/src/app/_components/global/NewsFigure.tsx +++ b/src/app/_components/global/NewsFigure.tsx @@ -71,6 +71,61 @@ export function NewsFigure({ post }: Readonly<{ post: PostWithTagsAndUser }>) { ); } +export function NewsFigureOrganization({ + post, +}: Readonly<{ post: PostWithTagsAndUser }>) { + return ( +
+
+ {post.slug} +
+
+
+
+ {post.tags.map((tag) => ( + + ))} +
+ +
+ + {post.title.length > 52 + ? post.title.slice(0, 48) + "..." + : post.title} + +
+ +
+
+
+ {post.user.name + + {trimName(post.user.name)} + +
+ + {post.published_at && stringifyDate(post.published_at)} + +
+
+
+ ); +} export function NewsSearchFigure({ post, }: Readonly<{ post: PostWithTagsAndUser }>) {