update
This commit is contained in:
parent
87528c9870
commit
ed583124f8
|
|
@ -30,6 +30,7 @@ type Article = {
|
||||||
description: string;
|
description: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
customCreatorName: string;
|
customCreatorName: string;
|
||||||
|
|
@ -278,6 +279,23 @@ export default function DetailContent() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function decodeHtmlString(raw: string = "") {
|
||||||
|
if (!raw) return "";
|
||||||
|
|
||||||
|
// 1️⃣ Hapus newline escape, backslash, dsb
|
||||||
|
let decoded = raw
|
||||||
|
.replace(/\\n/g, "\n")
|
||||||
|
.replace(/\\"/g, '"') // ubah \" jadi "
|
||||||
|
.replace(/\\'/g, "'") // ubah \' jadi '
|
||||||
|
.replace(/\\\\/g, "\\") // ubah \\ jadi \
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
// 2️⃣ Decode entity HTML (misal ")
|
||||||
|
const el = document.createElement("textarea");
|
||||||
|
el.innerHTML = decoded;
|
||||||
|
return el.value;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="bg-white grid grid-cols-1 md:grid-cols-3 gap-6 px-8 py-8">
|
<div className="bg-white grid grid-cols-1 md:grid-cols-3 gap-6 px-8 py-8">
|
||||||
|
|
@ -479,9 +497,9 @@ export default function DetailContent() {
|
||||||
</svg>
|
</svg>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-gray-500 mt-2 text-start">
|
{/* <p className="text-sm text-gray-500 mt-2 text-start">
|
||||||
{articleDetail?.slug}
|
{articleDetail?.slug}
|
||||||
</p>
|
</p> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex relative">
|
<div className="flex relative">
|
||||||
<div className="flex-1 overflow-y-auto">
|
<div className="flex-1 overflow-y-auto">
|
||||||
|
|
@ -489,8 +507,13 @@ export default function DetailContent() {
|
||||||
{/* <span className="text-black font-bold text-md">
|
{/* <span className="text-black font-bold text-md">
|
||||||
Mikulnews.com -
|
Mikulnews.com -
|
||||||
</span> */}
|
</span> */}
|
||||||
|
<div
|
||||||
{articleDetail?.description}
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: decodeHtmlString(
|
||||||
|
articleDetail?.htmlDescription || ""
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
<div className="w-full bg-white py-6">
|
<div className="w-full bg-white py-6">
|
||||||
<p className="mx-10 text-2xl mb-4 ">AUTHOR</p>
|
<p className="mx-10 text-2xl mb-4 ">AUTHOR</p>
|
||||||
|
|
@ -737,7 +760,7 @@ export default function DetailContent() {
|
||||||
<div className="flex items-center text-xs text-gray-500 mt-1 space-x-2">
|
<div className="flex items-center text-xs text-gray-500 mt-1 space-x-2">
|
||||||
<span>
|
<span>
|
||||||
📅{" "}
|
📅{" "}
|
||||||
{new Date(article.createdAt).toLocaleDateString(
|
{new Date(article.publishedAt).toLocaleDateString(
|
||||||
"id-ID",
|
"id-ID",
|
||||||
{
|
{
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ type Article = {
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
thumbnailUrl: string;
|
thumbnailUrl: string;
|
||||||
categories: { title: string }[];
|
categories: { title: string }[];
|
||||||
|
|
@ -93,11 +94,14 @@ export default function HeaderEkonomi() {
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-gray-700 mt-4">
|
<p className="text-sm text-gray-700 mt-4">
|
||||||
By <strong>{article.createdByName}</strong> —{" "}
|
By <strong>{article.createdByName}</strong> —{" "}
|
||||||
{new Date(article.createdAt).toLocaleDateString("en-US", {
|
{new Date(article.publishedAt).toLocaleDateString(
|
||||||
month: "long",
|
"en-US",
|
||||||
day: "numeric",
|
{
|
||||||
year: "numeric",
|
month: "long",
|
||||||
})}
|
day: "numeric",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
<Link
|
<Link
|
||||||
href={`/details/${article.slug}`}
|
href={`/details/${article.slug}`}
|
||||||
|
|
@ -149,7 +153,7 @@ export default function HeaderEkonomi() {
|
||||||
{post.title}
|
{post.title}
|
||||||
</h5>
|
</h5>
|
||||||
<p className="text-xs text-gray-500 mt-1">
|
<p className="text-xs text-gray-500 mt-1">
|
||||||
{new Date(post.createdAt).toLocaleDateString("en-US", {
|
{new Date(post.publishedAt).toLocaleDateString("en-US", {
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ type Article = {
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
thumbnailUrl: string;
|
thumbnailUrl: string;
|
||||||
categories: { title: string }[];
|
categories: { title: string }[];
|
||||||
|
|
@ -92,11 +94,14 @@ export default function HeaderHealth() {
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-gray-700 mt-4">
|
<p className="text-sm text-gray-700 mt-4">
|
||||||
By <strong>{article.createdByName}</strong> —{" "}
|
By <strong>{article.createdByName}</strong> —{" "}
|
||||||
{new Date(article.createdAt).toLocaleDateString("en-US", {
|
{new Date(article.publishedAt).toLocaleDateString(
|
||||||
month: "long",
|
"en-US",
|
||||||
day: "numeric",
|
{
|
||||||
year: "numeric",
|
month: "long",
|
||||||
})}
|
day: "numeric",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
<Link
|
<Link
|
||||||
href={`/details/${article.slug}`}
|
href={`/details/${article.slug}`}
|
||||||
|
|
@ -148,7 +153,7 @@ export default function HeaderHealth() {
|
||||||
{post.title}
|
{post.title}
|
||||||
</h5>
|
</h5>
|
||||||
<p className="text-xs text-gray-500 mt-1">
|
<p className="text-xs text-gray-500 mt-1">
|
||||||
{new Date(post.createdAt).toLocaleDateString("en-US", {
|
{new Date(post.publishedAt).toLocaleDateString("en-US", {
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ type Article = {
|
||||||
slug: string;
|
slug: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
thumbnailUrl: string;
|
thumbnailUrl: string;
|
||||||
categories: { title: string }[];
|
categories: { title: string }[];
|
||||||
|
|
@ -92,11 +93,14 @@ export default function HeaderNarrative() {
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-gray-700 mt-4">
|
<p className="text-sm text-gray-700 mt-4">
|
||||||
By <strong>{article.createdByName}</strong> —{" "}
|
By <strong>{article.createdByName}</strong> —{" "}
|
||||||
{new Date(article.createdAt).toLocaleDateString("en-US", {
|
{new Date(article.publishedAt).toLocaleDateString(
|
||||||
month: "long",
|
"en-US",
|
||||||
day: "numeric",
|
{
|
||||||
year: "numeric",
|
month: "long",
|
||||||
})}
|
day: "numeric",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
<Link
|
<Link
|
||||||
href={`/details/${article.slug}`}
|
href={`/details/${article.slug}`}
|
||||||
|
|
@ -148,7 +152,7 @@ export default function HeaderNarrative() {
|
||||||
{post.title}
|
{post.title}
|
||||||
</h5>
|
</h5>
|
||||||
<p className="text-xs text-gray-500 mt-1">
|
<p className="text-xs text-gray-500 mt-1">
|
||||||
{new Date(post.createdAt).toLocaleDateString("en-US", {
|
{new Date(post.publishedAt).toLocaleDateString("en-US", {
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ type Article = {
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
thumbnailUrl: string;
|
thumbnailUrl: string;
|
||||||
categories: {
|
categories: {
|
||||||
|
|
@ -93,7 +94,7 @@ export default function Beranda() {
|
||||||
<div className="flex items-center text-white text-xs gap-2">
|
<div className="flex items-center text-white text-xs gap-2">
|
||||||
<CalendarDays size={14} />
|
<CalendarDays size={14} />
|
||||||
<span>
|
<span>
|
||||||
{new Date(item.createdAt).toLocaleDateString("id-ID", {
|
{new Date(item.publishedAt).toLocaleDateString("id-ID", {
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
month: "long",
|
month: "long",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ type Article = {
|
||||||
description: string;
|
description: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
thumbnailUrl: string;
|
thumbnailUrl: string;
|
||||||
|
|
@ -126,7 +127,13 @@ const MoreNews = () => {
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-gray-500 text-xs flex items-center gap-1">
|
<p className="text-gray-500 text-xs flex items-center gap-1">
|
||||||
<Timer className="text-teal-600" size={15} />
|
<Timer className="text-teal-600" size={15} />
|
||||||
{item.createdAt}
|
<span>
|
||||||
|
{new Date(item?.publishedAt).toLocaleDateString("id-ID", {
|
||||||
|
day: "numeric",
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@ type Article = {
|
||||||
description: string;
|
description: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
customCreatorName: string;
|
customCreatorName: string;
|
||||||
|
|
@ -313,7 +314,7 @@ export default function News() {
|
||||||
<div className="flex items-center text-white text-xs gap-2 mt-2">
|
<div className="flex items-center text-white text-xs gap-2 mt-2">
|
||||||
<CalendarDays size={14} />
|
<CalendarDays size={14} />
|
||||||
<span>
|
<span>
|
||||||
{new Date(item.createdAt).toLocaleDateString("id-ID", {
|
{new Date(item.publishedAt).toLocaleDateString("id-ID", {
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
month: "long",
|
month: "long",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
|
|
@ -344,7 +345,14 @@ export default function News() {
|
||||||
</h4>
|
</h4>
|
||||||
<div className="flex items-center text-xs text-gray-500 gap-2 mt-1">
|
<div className="flex items-center text-xs text-gray-500 gap-2 mt-1">
|
||||||
<CalendarDays size={12} />
|
<CalendarDays size={12} />
|
||||||
<span>{item.createdAt}</span>
|
<span>
|
||||||
|
{" "}
|
||||||
|
{new Date(item.publishedAt).toLocaleDateString("id-ID", {
|
||||||
|
day: "2-digit",
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
@ -434,7 +442,7 @@ export default function News() {
|
||||||
<CalendarDays size={14} />
|
<CalendarDays size={14} />
|
||||||
<span>
|
<span>
|
||||||
{new Date(
|
{new Date(
|
||||||
articles[0]?.createdAt || ""
|
articles[0]?.publishedAt || ""
|
||||||
).toLocaleDateString("id-ID", {
|
).toLocaleDateString("id-ID", {
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
month: "long",
|
month: "long",
|
||||||
|
|
@ -481,7 +489,16 @@ export default function News() {
|
||||||
BY <span className="text-[#49C5C4]">ADMIN</span>
|
BY <span className="text-[#49C5C4]">ADMIN</span>
|
||||||
</span>
|
</span>
|
||||||
<Timer className="text-[#49C5C4]" size={12} />
|
<Timer className="text-[#49C5C4]" size={12} />
|
||||||
<span>{item.createdAt}</span>
|
<span>
|
||||||
|
{new Date(item?.publishedAt || "").toLocaleDateString(
|
||||||
|
"id-ID",
|
||||||
|
{
|
||||||
|
day: "2-digit",
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
@ -561,7 +578,16 @@ export default function News() {
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<span>{post.createdAt}</span>
|
<span>
|
||||||
|
{new Date(post?.publishedAt || "").toLocaleDateString(
|
||||||
|
"id-ID",
|
||||||
|
{
|
||||||
|
day: "2-digit",
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<MessageCircle size={14} className="text-[#49C5C4]" />
|
<MessageCircle size={14} className="text-[#49C5C4]" />
|
||||||
<span>{/* {post.comments} */}0</span>
|
<span>{/* {post.comments} */}0</span>
|
||||||
|
|
@ -637,7 +663,16 @@ export default function News() {
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<span>{post.createdAt}</span>
|
<span>
|
||||||
|
{new Date(post?.publishedAt || "").toLocaleDateString(
|
||||||
|
"id-ID",
|
||||||
|
{
|
||||||
|
day: "2-digit",
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<MessageCircle size={14} className="text-[#49C5C4]" />
|
<MessageCircle size={14} className="text-[#49C5C4]" />
|
||||||
<span>{/* {post.comments} */}0</span>
|
<span>{/* {post.comments} */}0</span>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ type Article = {
|
||||||
description: string;
|
description: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
publishedAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
thumbnailUrl: string;
|
thumbnailUrl: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
|
|
@ -134,7 +135,7 @@ const TravelNews = () => {
|
||||||
{item.title}
|
{item.title}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-white text-sm mt-2">
|
<p className="text-white text-sm mt-2">
|
||||||
{new Date(item.createdAt).toLocaleDateString("id-ID", {
|
{new Date(item.publishedAt).toLocaleDateString("id-ID", {
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
month: "long",
|
month: "long",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue