This commit is contained in:
Anang Yusman 2025-09-23 16:27:41 +08:00
parent deee3aecb9
commit 7768cff6af
15 changed files with 41 additions and 37 deletions

View File

@ -21,7 +21,7 @@ type Article = {
title: string; title: string;
}[]; }[];
files: { files: {
file_url: string; fileUrl: string;
file_alt: string; file_alt: string;
}[]; }[];
}; };
@ -206,9 +206,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}

View File

@ -614,9 +614,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>
@ -631,7 +629,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>
@ -654,7 +652,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>

View File

@ -196,16 +196,14 @@ export default function Login() {
<Link href={"/"}> <Link href={"/"}>
<div className="pl-16 bg-white rounded-md"> <div className="pl-16 bg-white rounded-md">
<img <img
src="/kebaikan-indonesia.png" src="/harapan.png"
alt="Mikul News Logo" alt="Mikul News Logo"
className="w-[400px] h-auto " className="w-[400px] h-auto "
/> />
</div> </div>
</Link> </Link>
<div className="mt-8 text-white/90"> <div className="mt-8 text-white/90">
<h2 className="text-2xl font-bold mb-2"> <h2 className="text-2xl font-bold mb-2">Portal Kabar Harapan</h2>
Portal Kebaikan Indonesia
</h2>
<p className="text-sm opacity-80"> <p className="text-sm opacity-80">
Platform berita terpercaya untuk informasi terkini Platform berita terpercaya untuk informasi terkini
</p> </p>
@ -428,7 +426,7 @@ export default function Login() {
Selamat Datang Selamat Datang
</h2> </h2>
<p className="text-gray-600"> <p className="text-gray-600">
Portal Kebaikan Indonesia- Platform berita terpercaya Portal Kabar Harapan- Platform berita terpercaya
</p> </p>
</div> </div>

View File

@ -11,7 +11,7 @@ type Article = {
createdByName: string; createdByName: string;
thumbnailUrl: string; thumbnailUrl: string;
categories: { title: string }[]; categories: { title: string }[];
files: { file_url: string; file_alt: string }[]; files: { fileUrl: string; file_alt: string }[];
}; };
export default function BannerNews() { export default function BannerNews() {
@ -51,7 +51,7 @@ export default function BannerNews() {
{/* Artikel utama */} {/* Artikel utama */}
<div className="lg:col-span-2 relative"> <div className="lg:col-span-2 relative">
<img <img
src={mainArticle.thumbnailUrl || mainArticle.files?.[0]?.file_url} src={mainArticle.thumbnailUrl || mainArticle.files?.[0]?.fileUrl}
alt={mainArticle.files?.[0]?.file_alt || mainArticle.title} alt={mainArticle.files?.[0]?.file_alt || mainArticle.title}
className="w-full h-[400px] object-cover rounded-lg" className="w-full h-[400px] object-cover rounded-lg"
/> />
@ -70,7 +70,7 @@ export default function BannerNews() {
{sideArticles.map((article) => ( {sideArticles.map((article) => (
<div key={article.id} className="relative"> <div key={article.id} className="relative">
<img <img
src={article.thumbnailUrl || article.files?.[0]?.file_url} src={article.thumbnailUrl || article.files?.[0]?.fileUrl}
alt={article.files?.[0]?.file_alt || article.title} alt={article.files?.[0]?.file_alt || article.title}
className="w-full h-[125px] object-cover rounded-lg" className="w-full h-[125px] object-cover rounded-lg"
/> />

View File

@ -15,7 +15,7 @@ type Article = {
createdByName: string; createdByName: string;
thumbnailUrl: string; thumbnailUrl: string;
categories: { title: string }[]; categories: { title: string }[];
files: { file_url: string; file_alt: string }[]; files: { fileUrl: string; file_alt: string }[];
}; };
type PaginationMeta = { type PaginationMeta = {
@ -82,7 +82,7 @@ export default function BreakingNews() {
<Image <Image
src={ src={
article.thumbnailUrl || article.thumbnailUrl ||
article.files?.[0]?.file_url || article.files?.[0]?.fileUrl ||
"/placeholder.jpg" "/placeholder.jpg"
} }
alt={article.files?.[0]?.file_alt || article.title} alt={article.files?.[0]?.file_alt || article.title}

View File

@ -16,7 +16,7 @@ type Article = {
title: string; title: string;
}[]; }[];
files: { files: {
file_url: string; fileUrl: string;
file_alt: string; file_alt: string;
}[]; }[];
}; };
@ -149,7 +149,7 @@ export default function News() {
{/* Item pertama tampil besar */} {/* Item pertama tampil besar */}
<div className="relative"> <div className="relative">
<Image <Image
src={popular[0]?.files?.[0]?.file_url || "/dummy.jpg"} src={popular[0]?.files?.[0]?.fileUrl || "/dummy.jpg"}
alt={ alt={
popular[0]?.files?.[0]?.file_alt || popular[0]?.files?.[0]?.file_alt ||
popular[0]?.title || popular[0]?.title ||

View File

@ -14,7 +14,7 @@ type Article = {
createdByName: string; createdByName: string;
thumbnailUrl: string; thumbnailUrl: string;
categories: { title: string }[]; categories: { title: string }[];
files: { file_url: string; file_alt: string }[]; files: { fileUrl: string; file_alt: string }[];
}; };
export default function HeaderPopular() { export default function HeaderPopular() {

View File

@ -15,7 +15,7 @@ type Article = {
createdByName: string; createdByName: string;
thumbnailUrl: string; thumbnailUrl: string;
categories: { title: string }[]; categories: { title: string }[];
files: { file_url: string; file_alt: string }[]; files: { fileUrl: string; file_alt: string }[];
}; };
export default function Header() { export default function Header() {

View File

@ -12,7 +12,7 @@ type Article = {
createdByName: string; createdByName: string;
thumbnailUrl: string; thumbnailUrl: string;
categories: { title: string }[]; categories: { title: string }[];
files: { file_url: string; file_alt: string }[]; files: { fileUrl: string; file_alt: string }[];
}; };
export default function LatestNews() { export default function LatestNews() {

View File

@ -13,7 +13,7 @@ type Article = {
createdByName: string; createdByName: string;
thumbnailUrl: string; thumbnailUrl: string;
categories: { title: string }[]; categories: { title: string }[];
files: { file_url: string; file_alt: string }[]; files: { fileUrl: string; file_alt: string }[];
}; };
export default function News() { export default function News() {
@ -134,7 +134,7 @@ function PostItem({ post }: { post: Article }) {
<div className="relative w-40 h-28 flex-shrink-0"> <div className="relative w-40 h-28 flex-shrink-0">
<Image <Image
src={ src={
post.thumbnailUrl || post.files?.[0]?.file_url || "/placeholder.jpg" post.thumbnailUrl || post.files?.[0]?.fileUrl || "/placeholder.jpg"
} }
alt={post.files?.[0]?.file_alt || post.title} alt={post.files?.[0]?.file_alt || post.title}
fill fill

View File

@ -211,7 +211,7 @@ const SidebarContent = ({
<Link href="/" className="flex items-center space-x-3"> <Link href="/" className="flex items-center space-x-3">
<div className="relative"> <div className="relative">
<img <img
src="/kebaikan-indonesia.png" src="/harapan.png"
className="w-10 h-10 rounded-lg shadow-sm" className="w-10 h-10 rounded-lg shadow-sm"
/> />
<div className="absolute -inset-1 bg-gradient-to-r from-blue-500 to-purple-500 rounded-lg opacity-20 blur-sm"></div> <div className="absolute -inset-1 bg-gradient-to-r from-blue-500 to-purple-500 rounded-lg opacity-20 blur-sm"></div>
@ -224,7 +224,7 @@ const SidebarContent = ({
className="flex flex-col" className="flex flex-col"
> >
<span className="text-sm font-bold bg-gradient-to-r from-slate-800 to-slate-600 bg-clip-text text-transparent"> <span className="text-sm font-bold bg-gradient-to-r from-slate-800 to-slate-600 bg-clip-text text-transparent">
Kebaikan Indonesia Kabar Harapan
</span> </span>
<span className="text-xs text-slate-500">Admin Panel</span> <span className="text-xs text-slate-500">Admin Panel</span>
</motion.div> </motion.div>

View File

@ -6,7 +6,7 @@ const axiosBaseInstance = axios.create({
baseURL, baseURL,
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640" "X-Client-Key": "f5a4ef1b-53ba-48df-9520-4c105dbec533",
}, },
}); });

View File

@ -10,7 +10,7 @@ const axiosInterceptorInstance = axios.create({
baseURL, baseURL,
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640" "X-Client-Key": "f5a4ef1b-53ba-48df-9520-4c105dbec533",
}, },
withCredentials: true, withCredentials: true,
}); });

View File

@ -2,11 +2,11 @@ import axiosBaseInstance from "./axios-base-instance";
const defaultHeaders = { const defaultHeaders = {
"Content-Type": "application/json", "Content-Type": "application/json",
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640" "X-Client-Key": "f5a4ef1b-53ba-48df-9520-4c105dbec533",
}; };
export async function httpGet(pathUrl: any, headers?: any) { export async function httpGet(pathUrl: any, headers?: any) {
console.log("X-HEADERS : ", defaultHeaders) console.log("X-HEADERS : ", defaultHeaders);
const mergedHeaders = { const mergedHeaders = {
...defaultHeaders, ...defaultHeaders,
...headers, ...headers,

View File

@ -5,11 +5,11 @@ import { getCsrfToken } from "../master-user";
const defaultHeaders = { const defaultHeaders = {
"Content-Type": "application/json", "Content-Type": "application/json",
"X-Client-Key": "bb65b1ad-e954-4a1a-b4d0-74df5bb0b640" "X-Client-Key": "f5a4ef1b-53ba-48df-9520-4c105dbec533",
}; };
export async function httpGetInterceptor(pathUrl: any) { export async function httpGetInterceptor(pathUrl: any) {
console.log("X-HEADERS : ", defaultHeaders) console.log("X-HEADERS : ", defaultHeaders);
const response = await axiosInterceptorInstance const response = await axiosInterceptorInstance
.get(pathUrl, { headers: defaultHeaders }) .get(pathUrl, { headers: defaultHeaders })
.catch((error) => error.response); .catch((error) => error.response);
@ -35,7 +35,11 @@ export async function httpGetInterceptor(pathUrl: any) {
} }
} }
export async function httpPostInterceptor(pathUrl: any, data: any, headers?: any) { export async function httpPostInterceptor(
pathUrl: any,
data: any,
headers?: any
) {
const resCsrf = await getCsrfToken(); const resCsrf = await getCsrfToken();
const csrfToken = resCsrf?.data?.csrf_token; const csrfToken = resCsrf?.data?.csrf_token;
@ -67,7 +71,11 @@ export async function httpPostInterceptor(pathUrl: any, data: any, headers?: any
} }
} }
export async function httpPutInterceptor(pathUrl: any, data: any, headers?: any) { export async function httpPutInterceptor(
pathUrl: any,
data: any,
headers?: any
) {
const resCsrf = await getCsrfToken(); const resCsrf = await getCsrfToken();
const csrfToken = resCsrf?.data?.csrf_token; const csrfToken = resCsrf?.data?.csrf_token;
@ -99,7 +107,7 @@ export async function httpPutInterceptor(pathUrl: any, data: any, headers?: any)
} }
export async function httpDeleteInterceptor(pathUrl: any, headers?: any) { export async function httpDeleteInterceptor(pathUrl: any, headers?: any) {
const resCsrf = await getCsrfToken(); const resCsrf = await getCsrfToken();
const csrfToken = resCsrf?.data?.csrf_token; const csrfToken = resCsrf?.data?.csrf_token;
const mergedHeaders = { const mergedHeaders = {