From 7d50f4b07069c94499cecf8ea3633bcbaef4574a Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Wed, 18 Jun 2025 11:39:17 +0700 Subject: [PATCH 1/2] fix detail article --- components/form/article/edit-article-form.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/form/article/edit-article-form.tsx b/components/form/article/edit-article-form.tsx index 7e98aa7..2681827 100644 --- a/components/form/article/edit-article-form.tsx +++ b/components/form/article/edit-article-form.tsx @@ -227,8 +227,9 @@ export default function EditArticleForm(props: { isDetail: boolean }) { setDiseId(data?.aiArticleId); setDetailFiles(data?.files); if ( - data.files[0].file_name.split(".")[1].includes("doc") || - data.files[0].file_name.split(".")[1].includes("pdf") + data?.files && + (data.files[0].file_name.split(".")[1].includes("doc") || + data.files[0].file_name.split(".")[1].includes("pdf")) ) { setSelectedFileType("document"); } else { @@ -734,7 +735,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) { )} {isDetail ? ( - detailfiles.length > 0 ? ( + detailfiles?.length > 0 ? ( selectedFileType === "document" ? ( detailfiles?.map((file: any, index: number) => ( From 3d420f48f23b7851ec17528d2f1ef99b4cca910e Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Wed, 18 Jun 2025 11:51:17 +0700 Subject: [PATCH 2/2] fix:date recap article --- components/landing/HeaderNews.tsx | 2 +- components/main/dashboard/dashboard-container.tsx | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/components/landing/HeaderNews.tsx b/components/landing/HeaderNews.tsx index 6cc1948..0dcc908 100644 --- a/components/landing/HeaderNews.tsx +++ b/components/landing/HeaderNews.tsx @@ -141,7 +141,7 @@ export default function HeaderNews() { src={ newsItem?.thumbnailUrl === "" ? "/no-image.jpg" - : newsItem?.thumbnailUrl + : newsItem?.thumbnailUrl + "?isBanner=true" } className={`!object-cover !rounded-none ${ portraitMap[index] diff --git a/components/main/dashboard/dashboard-container.tsx b/components/main/dashboard/dashboard-container.tsx index 3d9376f..36fd5dd 100644 --- a/components/main/dashboard/dashboard-container.tsx +++ b/components/main/dashboard/dashboard-container.tsx @@ -60,7 +60,7 @@ import { parseAbsoluteToLocal, } from "@internationalized/date"; import { Input } from "@heroui/input"; -import { EyeIconMdi } from "@/components/icons"; +import { EyeIconMdi, SearchIcons } from "@/components/icons"; type ArticleData = Article & { no: number; @@ -193,7 +193,7 @@ export default function DashboardContainer() { useEffect(() => { fetchPostCount(); - }, [postContentDate, selectedCategory]); + }, [selectedCategory]); async function fetchPostCount() { const getDate = (data: any) => { @@ -419,6 +419,7 @@ export default function DashboardContainer() {

{ e && setPostContentDate(e); @@ -434,6 +435,14 @@ export default function DashboardContainer() { }} size="sm" variant="bordered" + endContent={ + fetchPostCount()} + > + + + } />