This commit is contained in:
Anang Yusman 2025-09-24 17:01:07 +08:00
parent 970221ef64
commit 5236d4d9d5
15 changed files with 2390 additions and 1421 deletions

View File

@ -13,6 +13,7 @@ type Article = {
id: number;
title: string;
description: string;
htmlDescription: string;
categoryName: string;
createdAt: string;
createdByName: string;
@ -21,7 +22,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -252,9 +253,9 @@ export default function DetailContent() {
</div>
<div className="w-full h-auto mb-6">
{articleDetail?.files?.[0]?.file_url ? (
{articleDetail?.files?.[0]?.fileUrl ? (
<Image
src={articleDetail.files[0].file_url}
src={articleDetail.files[0].fileUrl}
alt="Berita"
width={800}
height={400}
@ -336,13 +337,17 @@ export default function DetailContent() {
</Link>
</div>
<div className="flex-1 overflow-y-auto">
<p className="text-gray-700 leading-relaxed text-justify">
<div className="prose max-w-none text-justify">
<span className="text-black font-bold text-md">
Mikulnews.com -
</span>
<div
dangerouslySetInnerHTML={{
__html: articleDetail?.htmlDescription || "",
}}
/>
</div>
{articleDetail?.description}
</p>
<Author />
<div className="flex flex-row gap-2 items-center">
<span className="font-semibold text-sm text-gray-700">

View File

@ -197,8 +197,8 @@ const TinyMCEEditor: React.FC<TinyMCEEditorProps> = ({
height,
language,
placeholder,
readonly: readOnly,
disabled,
// readonly: readOnly,
// disabled,
branding: false,
elementpath: false,
resize: false,
@ -270,9 +270,9 @@ const TinyMCEEditor: React.FC<TinyMCEEditorProps> = ({
onInit={handleEditorInit}
initialValue={initialData}
onEditorChange={handleEditorChange}
disabled={disabled}
disabled={disabled || readOnly}
apiKey={process.env.NEXT_PUBLIC_TINYMCE_API_KEY}
// init={editorConfig}
init={editorConfig}
/>
{/* Status bar */}

View File

@ -623,9 +623,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
alt="main"
width={720}
height={480}
src={
detailfiles[mainImage]?.file_url || "/default-avatar.png"
}
src={detailfiles[mainImage]?.fileUrl || "/default-avatar.png"}
className="w-[75%] mx-auto"
/>
</div>
@ -640,7 +638,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
width={480}
height={360}
alt={`image-${index}`}
src={file.file_url || "/default-avatar.png"}
src={file.fileUrl || "/default-avatar.png"}
className="h-[100px] object-cover w-[150px]"
/>
</a>
@ -663,7 +661,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
width={480}
height={360}
alt={`image-${index}`}
src={file?.file_url || "/default-avatar.png"}
src={file?.fileUrl || "/default-avatar.png"}
className="h-[100px] object-cover w-[150px]"
/>
</div>
@ -683,6 +681,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
</div>
<Button
type="button"
className=" border-none rounded-full"
variant="outline"
color="danger"

View File

@ -293,6 +293,7 @@ export default function GenerateContentRewriteForm(props: {
<div className="flex flex-row gap-1 mt-2">
{articleIds?.map((id, index) => (
<Button
type="button"
key={id}
onClick={() => setSelectedId(id)}
disabled={isLoading && selectedId === id}

View File

@ -18,7 +18,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -287,7 +287,7 @@ export default function CitizenNews() {
<Image
src={
articles[0]?.thumbnailUrl ||
articles[0]?.files?.[0]?.file_url ||
articles[0]?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"articles[0]?.title"}
@ -339,7 +339,7 @@ export default function CitizenNews() {
<Image
src={
article?.thumbnailUrl ||
article?.files?.[0]?.file_url ||
article?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"article?.title"}

View File

@ -18,7 +18,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -110,7 +110,7 @@ export default function HeaderCitizen() {
<div className="md:col-span-2 relative">
<Link href={`/detail/${mainArticle.id}`}>
<Image
src={mainArticle.files?.[0]?.file_url || "/default-image.jpg"}
src={mainArticle.files?.[0]?.fileUrl || "/default-image.jpg"}
alt={mainArticle.title}
width={800}
height={500}
@ -146,7 +146,7 @@ export default function HeaderCitizen() {
<Image
src={
article.thumbnailUrl ||
article.files?.[0]?.file_url ||
article.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={article.title}

View File

@ -18,7 +18,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -286,7 +286,7 @@ export default function DevelopmentNews() {
<Image
src={
articles[0]?.thumbnailUrl ||
articles[0]?.files?.[0]?.file_url ||
articles[0]?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"articles[0]?.title"}
@ -338,7 +338,7 @@ export default function DevelopmentNews() {
<Image
src={
article?.thumbnailUrl ||
article?.files?.[0]?.file_url ||
article?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"article?.title"}

View File

@ -18,7 +18,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -114,7 +114,7 @@ export default function HeaderDevelopment() {
<div className="md:col-span-2 relative">
<Link href={`/detail/${mainArticle.id}`}>
<Image
src={mainArticle.files?.[0]?.file_url || "/default-image.jpg"}
src={mainArticle.files?.[0]?.fileUrl || "/default-image.jpg"}
alt={mainArticle.title}
width={800}
height={500}
@ -150,7 +150,7 @@ export default function HeaderDevelopment() {
<Image
src={
article.thumbnailUrl ||
article.files?.[0]?.file_url ||
article.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={article.title}

View File

@ -17,7 +17,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -79,8 +79,8 @@ export default function HeroNewsSection() {
<Link href={`/detail/${articles[0]?.id}`}>
<Image
src={
articles[0]?.files?.[0]?.file_url ||
articles[0]?.files?.[0]?.file_url ||
articles[0]?.files?.[0]?.fileUrl ||
articles[0]?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={articles[0].title}
@ -132,7 +132,7 @@ export default function HeroNewsSection() {
<Image
src={
article.thumbnailUrl ||
article?.files?.[0]?.file_url ||
article?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={article.title}

View File

@ -18,7 +18,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -110,7 +110,7 @@ export default function HeaderHealth() {
<div className="md:col-span-2 relative">
<Link href={`/detail/${mainArticle.id}`}>
<Image
src={mainArticle.files?.[0]?.file_url || "/default-image.jpg"}
src={mainArticle.files?.[0]?.fileUrl || "/default-image.jpg"}
alt={mainArticle.title}
width={800}
height={500}
@ -146,7 +146,7 @@ export default function HeaderHealth() {
<Image
src={
article.thumbnailUrl ||
article.files?.[0]?.file_url ||
article.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={article.title}

View File

@ -18,7 +18,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -278,7 +278,7 @@ export default function HealthNews() {
<Image
src={
articles[0]?.thumbnailUrl ||
articles[0]?.files?.[0]?.file_url ||
articles[0]?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"articles[0]?.title"}
@ -330,7 +330,7 @@ export default function HealthNews() {
<Image
src={
article?.thumbnailUrl ||
article?.files?.[0]?.file_url ||
article?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"article?.title"}

View File

@ -178,7 +178,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -255,7 +255,7 @@ export default function LatestandPopular() {
<Image
src={
article?.thumbnailUrl ||
article?.files?.[0]?.file_url ||
article?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={article?.title || "No title"}
@ -371,7 +371,7 @@ export default function LatestandPopular() {
<Image
src={
articles[0]?.thumbnailUrl ||
articles[0]?.files?.[0]?.file_url ||
articles[0]?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"articles[0]?.title"}
@ -423,7 +423,7 @@ export default function LatestandPopular() {
<Image
src={
article?.thumbnailUrl ||
article?.files?.[0]?.file_url ||
article?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={"article?.title"}

View File

@ -184,7 +184,7 @@ type Article = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -251,7 +251,7 @@ export default function Latest({ id }: { id: number }) {
<div className="relative w-full aspect-video mb-5">
<Link href={`/detail/${articles[0]?.id}`}>
<Image
src={articles[0]?.files?.[0]?.file_url || "/nodata.png"}
src={articles[0]?.files?.[0]?.fileUrl || "/nodata.png"}
alt={"articles[0]?.title"}
fill
sizes="(max-width: 1024px) 100vw, 33vw"
@ -345,7 +345,7 @@ export default function Latest({ id }: { id: number }) {
<Link href={`/detail/${articles[0]?.id}`}>
<Image
src={
articles[0]?.files?.[0]?.file_url || "/default-image.jpg"
articles[0]?.files?.[0]?.fileUrl || "/default-image.jpg"
}
alt={"articles[0]?.title"}
fill
@ -477,7 +477,7 @@ export default function Latest({ id }: { id: number }) {
<Link href={`/detail/${post?.id}`}>
<div
className={`flex gap-4 ${
post.files?.[0]?.file_url
post.files?.[0]?.fileUrl
? "flex-col md:flex-row"
: "flex-col"
}`}

View File

@ -17,7 +17,7 @@ type postsData = {
title: string;
}[];
files: {
file_url: string;
fileUrl: string;
file_alt: string;
}[];
};
@ -87,7 +87,7 @@ export default function Beranda() {
<Image
src={
post.thumbnailUrl ||
post?.files?.[0]?.file_url ||
post?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={post.title}
@ -156,7 +156,7 @@ export default function Beranda() {
<Image
src={
post.thumbnailUrl ||
post?.files?.[0]?.file_url ||
post?.files?.[0]?.fileUrl ||
"/default-image.jpg"
}
alt={post.title}

3710
package-lock.json generated

File diff suppressed because it is too large Load Diff