update
This commit is contained in:
parent
970221ef64
commit
5236d4d9d5
|
|
@ -13,6 +13,7 @@ type Article = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
htmlDescription: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
createdByName: string;
|
createdByName: string;
|
||||||
|
|
@ -21,7 +22,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -252,9 +253,9 @@ export default function DetailContent() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full h-auto mb-6">
|
<div className="w-full h-auto mb-6">
|
||||||
{articleDetail?.files?.[0]?.file_url ? (
|
{articleDetail?.files?.[0]?.fileUrl ? (
|
||||||
<Image
|
<Image
|
||||||
src={articleDetail.files[0].file_url}
|
src={articleDetail.files[0].fileUrl}
|
||||||
alt="Berita"
|
alt="Berita"
|
||||||
width={800}
|
width={800}
|
||||||
height={400}
|
height={400}
|
||||||
|
|
@ -336,13 +337,17 @@ export default function DetailContent() {
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 overflow-y-auto">
|
<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">
|
<span className="text-black font-bold text-md">
|
||||||
Mikulnews.com -
|
Mikulnews.com -
|
||||||
</span>
|
</span>
|
||||||
|
<div
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: articleDetail?.htmlDescription || "",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
{articleDetail?.description}
|
|
||||||
</p>
|
|
||||||
<Author />
|
<Author />
|
||||||
<div className="flex flex-row gap-2 items-center">
|
<div className="flex flex-row gap-2 items-center">
|
||||||
<span className="font-semibold text-sm text-gray-700">
|
<span className="font-semibold text-sm text-gray-700">
|
||||||
|
|
|
||||||
|
|
@ -197,8 +197,8 @@ const TinyMCEEditor: React.FC<TinyMCEEditorProps> = ({
|
||||||
height,
|
height,
|
||||||
language,
|
language,
|
||||||
placeholder,
|
placeholder,
|
||||||
readonly: readOnly,
|
// readonly: readOnly,
|
||||||
disabled,
|
// disabled,
|
||||||
branding: false,
|
branding: false,
|
||||||
elementpath: false,
|
elementpath: false,
|
||||||
resize: false,
|
resize: false,
|
||||||
|
|
@ -270,9 +270,9 @@ const TinyMCEEditor: React.FC<TinyMCEEditorProps> = ({
|
||||||
onInit={handleEditorInit}
|
onInit={handleEditorInit}
|
||||||
initialValue={initialData}
|
initialValue={initialData}
|
||||||
onEditorChange={handleEditorChange}
|
onEditorChange={handleEditorChange}
|
||||||
disabled={disabled}
|
disabled={disabled || readOnly}
|
||||||
apiKey={process.env.NEXT_PUBLIC_TINYMCE_API_KEY}
|
apiKey={process.env.NEXT_PUBLIC_TINYMCE_API_KEY}
|
||||||
// init={editorConfig}
|
init={editorConfig}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Status bar */}
|
{/* Status bar */}
|
||||||
|
|
|
||||||
|
|
@ -623,9 +623,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
alt="main"
|
alt="main"
|
||||||
width={720}
|
width={720}
|
||||||
height={480}
|
height={480}
|
||||||
src={
|
src={detailfiles[mainImage]?.fileUrl || "/default-avatar.png"}
|
||||||
detailfiles[mainImage]?.file_url || "/default-avatar.png"
|
|
||||||
}
|
|
||||||
className="w-[75%] mx-auto"
|
className="w-[75%] mx-auto"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -640,7 +638,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
width={480}
|
width={480}
|
||||||
height={360}
|
height={360}
|
||||||
alt={`image-${index}`}
|
alt={`image-${index}`}
|
||||||
src={file.file_url || "/default-avatar.png"}
|
src={file.fileUrl || "/default-avatar.png"}
|
||||||
className="h-[100px] object-cover w-[150px]"
|
className="h-[100px] object-cover w-[150px]"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -663,7 +661,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
width={480}
|
width={480}
|
||||||
height={360}
|
height={360}
|
||||||
alt={`image-${index}`}
|
alt={`image-${index}`}
|
||||||
src={file?.file_url || "/default-avatar.png"}
|
src={file?.fileUrl || "/default-avatar.png"}
|
||||||
className="h-[100px] object-cover w-[150px]"
|
className="h-[100px] object-cover w-[150px]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -683,6 +681,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
type="button"
|
||||||
className=" border-none rounded-full"
|
className=" border-none rounded-full"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
color="danger"
|
color="danger"
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,7 @@ export default function GenerateContentRewriteForm(props: {
|
||||||
<div className="flex flex-row gap-1 mt-2">
|
<div className="flex flex-row gap-1 mt-2">
|
||||||
{articleIds?.map((id, index) => (
|
{articleIds?.map((id, index) => (
|
||||||
<Button
|
<Button
|
||||||
|
type="button"
|
||||||
key={id}
|
key={id}
|
||||||
onClick={() => setSelectedId(id)}
|
onClick={() => setSelectedId(id)}
|
||||||
disabled={isLoading && selectedId === id}
|
disabled={isLoading && selectedId === id}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -287,7 +287,7 @@ export default function CitizenNews() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
articles[0]?.thumbnailUrl ||
|
articles[0]?.thumbnailUrl ||
|
||||||
articles[0]?.files?.[0]?.file_url ||
|
articles[0]?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"articles[0]?.title"}
|
alt={"articles[0]?.title"}
|
||||||
|
|
@ -339,7 +339,7 @@ export default function CitizenNews() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article?.thumbnailUrl ||
|
article?.thumbnailUrl ||
|
||||||
article?.files?.[0]?.file_url ||
|
article?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"article?.title"}
|
alt={"article?.title"}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -110,7 +110,7 @@ export default function HeaderCitizen() {
|
||||||
<div className="md:col-span-2 relative">
|
<div className="md:col-span-2 relative">
|
||||||
<Link href={`/detail/${mainArticle.id}`}>
|
<Link href={`/detail/${mainArticle.id}`}>
|
||||||
<Image
|
<Image
|
||||||
src={mainArticle.files?.[0]?.file_url || "/default-image.jpg"}
|
src={mainArticle.files?.[0]?.fileUrl || "/default-image.jpg"}
|
||||||
alt={mainArticle.title}
|
alt={mainArticle.title}
|
||||||
width={800}
|
width={800}
|
||||||
height={500}
|
height={500}
|
||||||
|
|
@ -146,7 +146,7 @@ export default function HeaderCitizen() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article.thumbnailUrl ||
|
article.thumbnailUrl ||
|
||||||
article.files?.[0]?.file_url ||
|
article.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={article.title}
|
alt={article.title}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -286,7 +286,7 @@ export default function DevelopmentNews() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
articles[0]?.thumbnailUrl ||
|
articles[0]?.thumbnailUrl ||
|
||||||
articles[0]?.files?.[0]?.file_url ||
|
articles[0]?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"articles[0]?.title"}
|
alt={"articles[0]?.title"}
|
||||||
|
|
@ -338,7 +338,7 @@ export default function DevelopmentNews() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article?.thumbnailUrl ||
|
article?.thumbnailUrl ||
|
||||||
article?.files?.[0]?.file_url ||
|
article?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"article?.title"}
|
alt={"article?.title"}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -114,7 +114,7 @@ export default function HeaderDevelopment() {
|
||||||
<div className="md:col-span-2 relative">
|
<div className="md:col-span-2 relative">
|
||||||
<Link href={`/detail/${mainArticle.id}`}>
|
<Link href={`/detail/${mainArticle.id}`}>
|
||||||
<Image
|
<Image
|
||||||
src={mainArticle.files?.[0]?.file_url || "/default-image.jpg"}
|
src={mainArticle.files?.[0]?.fileUrl || "/default-image.jpg"}
|
||||||
alt={mainArticle.title}
|
alt={mainArticle.title}
|
||||||
width={800}
|
width={800}
|
||||||
height={500}
|
height={500}
|
||||||
|
|
@ -150,7 +150,7 @@ export default function HeaderDevelopment() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article.thumbnailUrl ||
|
article.thumbnailUrl ||
|
||||||
article.files?.[0]?.file_url ||
|
article.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={article.title}
|
alt={article.title}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -79,8 +79,8 @@ export default function HeroNewsSection() {
|
||||||
<Link href={`/detail/${articles[0]?.id}`}>
|
<Link href={`/detail/${articles[0]?.id}`}>
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
articles[0]?.files?.[0]?.file_url ||
|
articles[0]?.files?.[0]?.fileUrl ||
|
||||||
articles[0]?.files?.[0]?.file_url ||
|
articles[0]?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={articles[0].title}
|
alt={articles[0].title}
|
||||||
|
|
@ -132,7 +132,7 @@ export default function HeroNewsSection() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article.thumbnailUrl ||
|
article.thumbnailUrl ||
|
||||||
article?.files?.[0]?.file_url ||
|
article?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={article.title}
|
alt={article.title}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -110,7 +110,7 @@ export default function HeaderHealth() {
|
||||||
<div className="md:col-span-2 relative">
|
<div className="md:col-span-2 relative">
|
||||||
<Link href={`/detail/${mainArticle.id}`}>
|
<Link href={`/detail/${mainArticle.id}`}>
|
||||||
<Image
|
<Image
|
||||||
src={mainArticle.files?.[0]?.file_url || "/default-image.jpg"}
|
src={mainArticle.files?.[0]?.fileUrl || "/default-image.jpg"}
|
||||||
alt={mainArticle.title}
|
alt={mainArticle.title}
|
||||||
width={800}
|
width={800}
|
||||||
height={500}
|
height={500}
|
||||||
|
|
@ -146,7 +146,7 @@ export default function HeaderHealth() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article.thumbnailUrl ||
|
article.thumbnailUrl ||
|
||||||
article.files?.[0]?.file_url ||
|
article.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={article.title}
|
alt={article.title}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -278,7 +278,7 @@ export default function HealthNews() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
articles[0]?.thumbnailUrl ||
|
articles[0]?.thumbnailUrl ||
|
||||||
articles[0]?.files?.[0]?.file_url ||
|
articles[0]?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"articles[0]?.title"}
|
alt={"articles[0]?.title"}
|
||||||
|
|
@ -330,7 +330,7 @@ export default function HealthNews() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article?.thumbnailUrl ||
|
article?.thumbnailUrl ||
|
||||||
article?.files?.[0]?.file_url ||
|
article?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"article?.title"}
|
alt={"article?.title"}
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -255,7 +255,7 @@ export default function LatestandPopular() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article?.thumbnailUrl ||
|
article?.thumbnailUrl ||
|
||||||
article?.files?.[0]?.file_url ||
|
article?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={article?.title || "No title"}
|
alt={article?.title || "No title"}
|
||||||
|
|
@ -371,7 +371,7 @@ export default function LatestandPopular() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
articles[0]?.thumbnailUrl ||
|
articles[0]?.thumbnailUrl ||
|
||||||
articles[0]?.files?.[0]?.file_url ||
|
articles[0]?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"articles[0]?.title"}
|
alt={"articles[0]?.title"}
|
||||||
|
|
@ -423,7 +423,7 @@ export default function LatestandPopular() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
article?.thumbnailUrl ||
|
article?.thumbnailUrl ||
|
||||||
article?.files?.[0]?.file_url ||
|
article?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"article?.title"}
|
alt={"article?.title"}
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ type Article = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -251,7 +251,7 @@ export default function Latest({ id }: { id: number }) {
|
||||||
<div className="relative w-full aspect-video mb-5">
|
<div className="relative w-full aspect-video mb-5">
|
||||||
<Link href={`/detail/${articles[0]?.id}`}>
|
<Link href={`/detail/${articles[0]?.id}`}>
|
||||||
<Image
|
<Image
|
||||||
src={articles[0]?.files?.[0]?.file_url || "/nodata.png"}
|
src={articles[0]?.files?.[0]?.fileUrl || "/nodata.png"}
|
||||||
alt={"articles[0]?.title"}
|
alt={"articles[0]?.title"}
|
||||||
fill
|
fill
|
||||||
sizes="(max-width: 1024px) 100vw, 33vw"
|
sizes="(max-width: 1024px) 100vw, 33vw"
|
||||||
|
|
@ -345,7 +345,7 @@ export default function Latest({ id }: { id: number }) {
|
||||||
<Link href={`/detail/${articles[0]?.id}`}>
|
<Link href={`/detail/${articles[0]?.id}`}>
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
articles[0]?.files?.[0]?.file_url || "/default-image.jpg"
|
articles[0]?.files?.[0]?.fileUrl || "/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={"articles[0]?.title"}
|
alt={"articles[0]?.title"}
|
||||||
fill
|
fill
|
||||||
|
|
@ -477,7 +477,7 @@ export default function Latest({ id }: { id: number }) {
|
||||||
<Link href={`/detail/${post?.id}`}>
|
<Link href={`/detail/${post?.id}`}>
|
||||||
<div
|
<div
|
||||||
className={`flex gap-4 ${
|
className={`flex gap-4 ${
|
||||||
post.files?.[0]?.file_url
|
post.files?.[0]?.fileUrl
|
||||||
? "flex-col md:flex-row"
|
? "flex-col md:flex-row"
|
||||||
: "flex-col"
|
: "flex-col"
|
||||||
}`}
|
}`}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ type postsData = {
|
||||||
title: string;
|
title: string;
|
||||||
}[];
|
}[];
|
||||||
files: {
|
files: {
|
||||||
file_url: string;
|
fileUrl: string;
|
||||||
file_alt: string;
|
file_alt: string;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
@ -87,7 +87,7 @@ export default function Beranda() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
post.thumbnailUrl ||
|
post.thumbnailUrl ||
|
||||||
post?.files?.[0]?.file_url ||
|
post?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={post.title}
|
alt={post.title}
|
||||||
|
|
@ -156,7 +156,7 @@ export default function Beranda() {
|
||||||
<Image
|
<Image
|
||||||
src={
|
src={
|
||||||
post.thumbnailUrl ||
|
post.thumbnailUrl ||
|
||||||
post?.files?.[0]?.file_url ||
|
post?.files?.[0]?.fileUrl ||
|
||||||
"/default-image.jpg"
|
"/default-image.jpg"
|
||||||
}
|
}
|
||||||
alt={post.title}
|
alt={post.title}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue