diff --git a/app/page.tsx b/app/page.tsx index 1f7cd7d..c821a1a 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -23,7 +23,7 @@ export default function Home() { /> -
- The reCAPTCHA verification period has expired. Please reload the - page. -
- - + KIRIM KOMENTAR + + > + ) : ( + <> ++ Kode verifikasi sudah dikirimkan. Silakan cek Email Anda! +
+Kreator
+Tipe Kreator
+Kategori
Tanggal
Waktu
+ setStartTimeValue(e.target.value)} + className="w-full border rounded-lg px-2 py-[6px] text-black" + /> +- {errors.htmlDescription.message} -
+ {errors.description?.message && ( +{errors.description.message}
)}File Media
{!isDetail && ( @@ -785,6 +796,43 @@ export default function EditArticleForm(props: { isDetail: boolean }) { )} > )} +Kreator
+Tipe Kreator
+Kategori
- {mainArticle.createdByName} -{" "}
+ {mainArticle?.customCreatorName ||
+ mainArticle.createdByName}{" "}
+ -{" "}
{new Date(mainArticle.createdAt).toLocaleDateString(
"id-ID",
{
diff --git a/components/landing-page/development/development-news.tsx b/components/landing-page/development/development-news.tsx
index 8a0a6e1..c5abc03 100644
--- a/components/landing-page/development/development-news.tsx
+++ b/components/landing-page/development/development-news.tsx
@@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
import news from "../news";
import Link from "next/link";
+import { getAdvertise } from "@/service/advertisement";
type Article = {
id: number;
@@ -13,6 +14,7 @@ type Article = {
categoryName: string;
createdAt: string;
createdByName: string;
+ customCreatorName: string;
thumbnailUrl: string;
categories: {
title: string;
@@ -23,6 +25,15 @@ type Article = {
}[];
};
+type Advertise = {
+ id: number;
+ title: string;
+ description: string;
+ placement: string;
+ contentFileUrl: string;
+ redirectLink: string;
+};
+
const slugToLabel = (slug: string) => {
const mapping: Record
- {mainArticle.createdByName} -{" "}
+ {mainArticle?.customCreatorName ||
+ mainArticle.createdByName}{" "}
+ -{" "}
{new Date(mainArticle.createdAt).toLocaleDateString(
"id-ID",
{
diff --git a/components/landing-page/header.tsx b/components/landing-page/header.tsx
index 1878280..96ea7fc 100644
--- a/components/landing-page/header.tsx
+++ b/components/landing-page/header.tsx
@@ -4,6 +4,7 @@ import { getListArticle } from "@/service/article";
import { useEffect, useState } from "react";
import Image from "next/image";
import Link from "next/link";
+import { getAdvertise } from "@/service/advertisement";
type Article = {
id: number;
@@ -12,6 +13,7 @@ type Article = {
categoryName: string;
createdAt: string;
createdByName: string;
+ customCreatorName: string;
thumbnailUrl: string;
categories: {
title: string;
@@ -22,6 +24,15 @@ type Article = {
}[];
};
+type Advertise = {
+ id: number;
+ title: string;
+ description: string;
+ placement: string;
+ contentFileUrl: string;
+ redirectLink: string;
+};
+
export default function HeroNewsSection() {
const [page, setPage] = useState(1);
const [totalPage, setTotalPage] = useState(1);
@@ -34,6 +45,36 @@ export default function HeroNewsSection() {
endDate: null,
});
+ const [bannerAd, setBannerAd] = useState
- {articles[0].createdByName} -{" "}
+ {articles[0]?.customCreatorName ||
+ articles[0]?.createdByName}{" "}
+ -{" "}
- {mainArticle.createdByName} -{" "}
+ {mainArticle?.customCreatorName ||
+ mainArticle.createdByName}{" "}
+ -{" "}
{new Date(mainArticle.createdAt).toLocaleDateString(
"id-ID",
{
diff --git a/components/landing-page/health/health-news.tsx b/components/landing-page/health/health-news.tsx
index 09942a9..0b71217 100644
--- a/components/landing-page/health/health-news.tsx
+++ b/components/landing-page/health/health-news.tsx
@@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
import { useEffect, useState } from "react";
import news from "../news";
import Link from "next/link";
+import { getAdvertise } from "@/service/advertisement";
type Article = {
id: number;
@@ -13,6 +14,7 @@ type Article = {
categoryName: string;
createdAt: string;
createdByName: string;
+ customCreatorName: string;
thumbnailUrl: string;
categories: {
title: string;
@@ -32,6 +34,15 @@ const slugToLabel = (slug: string) => {
return mapping[slug] || slug.charAt(0).toUpperCase() + slug.slice(1);
};
+type Advertise = {
+ id: number;
+ title: string;
+ description: string;
+ placement: string;
+ contentFileUrl: string;
+ redirectLink: string;
+};
+
export default function HealthNews() {
const [activeTab, setActiveTab] = useState("comments");
const [page, setPage] = useState(1);
@@ -48,6 +59,36 @@ export default function HealthNews() {
const pathname = usePathname();
const pathSegments = pathname.split("/").filter(Boolean);
+ const [bannerAd, setBannerAd] = useState {summary?.totalToday}
+ {summary?.totalToday}
+ Today {summary?.totalThisWeek}
+ {summary?.totalThisWeek}
+ This Week {summary?.totalAll}
+ {summary?.totalAll}
+ Total Posts {summary?.totalViews}
+ {summary?.totalViews}
+ Total Views {summary?.totalShares}
+ {summary?.totalShares}
+ Total SharesKesehatan
@@ -176,7 +237,7 @@ export default function Beranda() {
{summary?.totalComments}
++ {summary?.totalComments} +
Total Comments
+ {article.customCreatorName && + article.customCreatorName.trim() !== "" + ? article.customCreatorName + : article.createdByName} +
+ ); case "isPublish": return ( //Kategori