fix: show createdAdd in new-content

This commit is contained in:
Sabda Yagra 2025-11-06 16:18:33 +07:00
parent 78518f038e
commit 618e5f4edb
2 changed files with 76 additions and 17 deletions

View File

@ -193,7 +193,6 @@ export default function FormConvertSPIT() {
const [showRewriteEditor, setShowRewriteEditor] = useState(false);
const [isGeneratingRewrite, setIsGeneratingRewrite] = useState(false);
const [isLoadingRewrite, setIsLoadingRewrite] = useState(false);
// <-- changed: detailThumb is now FileType[] (objects from API) -->
const [detailThumb, setDetailThumb] = useState<FileType[]>([]);
const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null);

View File

@ -19,6 +19,8 @@ import { Skeleton } from "../ui/skeleton";
import Image from "next/image";
import { motion } from "framer-motion";
import ImageBlurry from "../ui/image-blurry";
import { formatDateToIndonesian } from "@/utils/globals";
import { Icon } from "../ui/icon";
const NewContent = (props: { group: string; type: string }) => {
const [newContent, setNewContent] = useState<any>();
@ -276,10 +278,24 @@ const NewContent = (props: { group: string; type: string }) => {
{/* Caption section */}
<div className="p-4 h-full flex flex-col justify-between">
<div className="flex flex-col gap-1 flex-grow">
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
{image?.categoryName?.toUpperCase() ??
"Giat Pimpinan"}
</p>
<div className="flex flex-row justify-between mb-2">
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
{image?.categoryName?.toUpperCase() ??
"Giat Pimpinan"}
</p>
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
{formatDateToIndonesian(
new Date(image?.createdAt)
)}{" "}
{image?.timezone ?? "WIB"} |
<Icon
icon="formkit:eye"
width="15"
height="15"
/>{" "}
{image.clickCount}
</p>
</div>
<Link
href={
prefixPath + `/image/detail/${image?.slug}`
@ -366,12 +382,26 @@ const NewContent = (props: { group: string; type: string }) => {
{/* Caption */}
<div className="p-4">
<p className="text-[12px] font-bold text-[#bb3523] uppercase mb-1">
{audio?.categoryName?.toUpperCase() ??
"GIAT PIMPINAN"}
</p>
<div className="flex flex-row justify-between mb-2">
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
{audio?.categoryName?.toUpperCase() ??
"Giat Pimpinan"}
</p>
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
{formatDateToIndonesian(
new Date(audio?.createdAt)
)}{" "}
{audio?.timezone ?? "WIB"} |
<Icon
icon="formkit:eye"
width="15"
height="15"
/>{" "}
{audio.clickCount}
</p>
</div>
<p className="text-xl font-semibold text-black dark:text-white line-clamp-4">
<p className="text-sm lg:text-base font-semibold text-black dark:text-white line-clamp-4">
{audio?.title}
</p>
@ -488,10 +518,25 @@ const NewContent = (props: { group: string; type: string }) => {
{/* Caption section */}
<div className="p-4 h-full flex flex-col justify-between">
<div className="flex flex-col gap-1 flex-grow">
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
{video?.categoryName?.toUpperCase() ??
"Giat Pimpinan"}
</p>
<div className="flex flex-row justify-between mb-2">
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
{video?.categoryName?.toUpperCase() ??
"Giat Pimpinan"}
</p>
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
{formatDateToIndonesian(
new Date(video?.createdAt)
)}{" "}
{video?.timezone ?? "WIB"} |
<Icon
icon="formkit:eye"
width="15"
height="15"
/>{" "}
{video.clickCount}
</p>
</div>
<Link
href={
prefixPath + `/video/detail/${video?.slug}`
@ -581,8 +626,23 @@ const NewContent = (props: { group: string; type: string }) => {
{/* Konten bawah */}
<div className="p-4 flex flex-col gap-2">
{/* Kategori merah */}
<div className="text-[12px] font-bold text-red-600 uppercase">
{text?.categoryName?.toUpperCase() ?? "Text"}
<div className="flex flex-row justify-between mb-2">
<p className="text-[10px] font-bold text-[#bb3523] uppercase">
{text?.categoryName?.toUpperCase() ??
"Giat Pimpinan"}
</p>
<p className="flex flex-row items-center text-[10px] gap-1 text-gray-600">
{formatDateToIndonesian(
new Date(text?.createdAt)
)}{" "}
{text?.timezone ?? "WIB"} |
<Icon
icon="formkit:eye"
width="15"
height="15"
/>{" "}
{text.clickCount}
</p>
</div>
{/* Judul */}
@ -591,7 +651,7 @@ const NewContent = (props: { group: string; type: string }) => {
prefixPath + `/document/detail/${text?.slug}`
}
>
<p className="font-semibold text-gray-900 dark:text-white text-xl leading-snug line-clamp-4">
<p className="font-semibold text-gray-900 dark:text-white text-sm lg:text-base leading-snug line-clamp-4">
{text?.title}
</p>
</Link>