pull main and fixing
This commit is contained in:
parent
0b40c99ce9
commit
5cdde1a75b
|
|
@ -2,6 +2,7 @@
|
||||||
import { Reveal } from "@/components/landing-page/Reveal";
|
import { Reveal } from "@/components/landing-page/Reveal";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
interface FAQItem {
|
interface FAQItem {
|
||||||
question: string;
|
question: string;
|
||||||
|
|
@ -41,19 +42,41 @@ const FAQS: React.FC = () => {
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<Reveal>
|
<Reveal>
|
||||||
<div className="flex items-center justify-center mb-6">
|
<div className="flex items-center justify-center mb-6">
|
||||||
<img src="/assets/icons-faqs.png" alt="Faqs" />
|
<Image
|
||||||
<h2 className="ml-4 text-lg lg:text-2xl font-bold text-gray-800 dark:text-white">Frequently Asked Questions</h2>
|
width={1920}
|
||||||
|
height={1080}
|
||||||
|
src="/assets/icons-faqs.png"
|
||||||
|
alt="Faqs"
|
||||||
|
className="h-12 w-12"
|
||||||
|
/>
|
||||||
|
<h2 className="ml-4 text-lg lg:text-2xl font-bold text-gray-800 dark:text-white">
|
||||||
|
Frequently Asked Questions
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* FAQS Items */}
|
{/* FAQS Items */}
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{faqs?.map((faq, index) => (
|
{faqs?.map((faq, index) => (
|
||||||
<div key={index} className="border-b border-gray-300 pb-2 cursor-pointer">
|
<div
|
||||||
<div className="flex justify-between items-center" onClick={() => toggleFAQ(index)}>
|
key={index}
|
||||||
<h3 className="text-sm font-semibold text-gray-800 dark:text-white">{faq.question}</h3>
|
className="border-b border-gray-300 pb-2 cursor-pointer"
|
||||||
<span className="text-gray-500 dark:text-white text-xl">{openIndex === index ? "−" : "+"}</span>
|
>
|
||||||
|
<div
|
||||||
|
className="flex justify-between items-center"
|
||||||
|
onClick={() => toggleFAQ(index)}
|
||||||
|
>
|
||||||
|
<h3 className="text-sm font-semibold text-gray-800 dark:text-white">
|
||||||
|
{faq.question}
|
||||||
|
</h3>
|
||||||
|
<span className="text-gray-500 dark:text-white text-xl">
|
||||||
|
{openIndex === index ? "−" : "+"}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{openIndex === index && <p className="text-gray-600 dark:text-white mt-2 text-sm">{faq.answer}</p>}
|
{openIndex === index && (
|
||||||
|
<p className="text-gray-600 dark:text-white mt-2 text-sm">
|
||||||
|
{faq.answer}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1029,8 +1029,6 @@ export default function FormImageDetail() {
|
||||||
listFiles: rejectedFiles,
|
listFiles: rejectedFiles,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("reject", dataReject);
|
|
||||||
|
|
||||||
const resReject = await rejectFiles(dataReject);
|
const resReject = await rejectFiles(dataReject);
|
||||||
|
|
||||||
if (resReject?.error) {
|
if (resReject?.error) {
|
||||||
|
|
|
||||||
|
|
@ -1,78 +1,145 @@
|
||||||
|
// import { listDataAdvertisements } from "@/service/broadcast/broadcast";
|
||||||
|
// import { useEffect, useState } from "react";
|
||||||
|
// import * as React from "react";
|
||||||
|
|
||||||
|
// interface Advertisement {
|
||||||
|
// id: string;
|
||||||
|
// placements: string;
|
||||||
|
// imageUrl: string;
|
||||||
|
// [key: string]: any;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // // Simulasi fungsi API (replace dengan yang asli)
|
||||||
|
// // async function listDataAdvertisements(
|
||||||
|
// // page: number,
|
||||||
|
// // size: number,
|
||||||
|
// // search: string,
|
||||||
|
// // category: string,
|
||||||
|
// // status: string
|
||||||
|
// // ) {
|
||||||
|
// // // contoh struktur response dummy
|
||||||
|
// // return {
|
||||||
|
// // data: {
|
||||||
|
// // data: {
|
||||||
|
// // content: [
|
||||||
|
// // { id: "1", imageUrl: "/images/all-img/kiri1.png" },
|
||||||
|
// // { id: "2", imageUrl: "/images/all-img/kiri2.png" },
|
||||||
|
// // ],
|
||||||
|
// // totalElements: 2,
|
||||||
|
// // totalPages: 1,
|
||||||
|
// // },
|
||||||
|
// // },
|
||||||
|
// // };
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// const AdvertisementPlacements = (props: {
|
||||||
|
// placement: string;
|
||||||
|
// data: Advertisement[];
|
||||||
|
// loading: boolean;
|
||||||
|
// }) => {
|
||||||
|
// const [ads, setAds] = useState<Advertisement[] | undefined[]>([]);
|
||||||
|
// useEffect(() => {
|
||||||
|
// if (!props.loading && props.data.length > 0) {
|
||||||
|
// console.log(
|
||||||
|
// "RRRRRR",
|
||||||
|
// props.data[0].placements.includes(props.placement),
|
||||||
|
// props.placement
|
||||||
|
// );
|
||||||
|
|
||||||
|
// const filtered = props.data.filter((a) =>
|
||||||
|
// a.placements.includes(props.placement)
|
||||||
|
// );
|
||||||
|
// let temps: Advertisement[] | undefined[] = [];
|
||||||
|
// temps[0] = filtered.find((b) => b.placements.includes("top"));
|
||||||
|
// temps[1] = filtered.find((b) => b.placements.includes("bottom"));
|
||||||
|
// setAds(temps);
|
||||||
|
// console.log("PPPPPP", filtered);
|
||||||
|
// }
|
||||||
|
// }, [props.data, props.loading]);
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <div
|
||||||
|
// className={`sticky top-0 space-y-4 ${
|
||||||
|
// props.placement == "left" ? "ml-14" : "mr-14"
|
||||||
|
// }`}
|
||||||
|
// >
|
||||||
|
// {props.loading && <p className="text-sm text-gray-500">Loading...</p>}
|
||||||
|
// {ads?.map(
|
||||||
|
// (ad) =>
|
||||||
|
// ad && (
|
||||||
|
// <img
|
||||||
|
// key={ad.id}
|
||||||
|
// src={ad.contentFileUrl}
|
||||||
|
// alt={`Banner ${ad.id}`}
|
||||||
|
// className="w-full"
|
||||||
|
// />
|
||||||
|
// )
|
||||||
|
// )}
|
||||||
|
// </div>
|
||||||
|
// );
|
||||||
|
// };
|
||||||
|
|
||||||
|
// export default AdvertisementPlacements;
|
||||||
import { listDataAdvertisements } from "@/service/broadcast/broadcast";
|
import { listDataAdvertisements } from "@/service/broadcast/broadcast";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
||||||
|
|
||||||
interface Advertisement {
|
interface Advertisement {
|
||||||
id: string;
|
id: string;
|
||||||
placements: string;
|
placements: string;
|
||||||
imageUrl: string;
|
imageUrl: string;
|
||||||
|
contentFileUrl?: string;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
// // Simulasi fungsi API (replace dengan yang asli)
|
|
||||||
// async function listDataAdvertisements(
|
|
||||||
// page: number,
|
|
||||||
// size: number,
|
|
||||||
// search: string,
|
|
||||||
// category: string,
|
|
||||||
// status: string
|
|
||||||
// ) {
|
|
||||||
// // contoh struktur response dummy
|
|
||||||
// return {
|
|
||||||
// data: {
|
|
||||||
// data: {
|
|
||||||
// content: [
|
|
||||||
// { id: "1", imageUrl: "/images/all-img/kiri1.png" },
|
|
||||||
// { id: "2", imageUrl: "/images/all-img/kiri2.png" },
|
|
||||||
// ],
|
|
||||||
// totalElements: 2,
|
|
||||||
// totalPages: 1,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
const AdvertisementPlacements = (props: {
|
const AdvertisementPlacements = (props: {
|
||||||
placement: string;
|
placement: string;
|
||||||
data: Advertisement[];
|
data: Advertisement[];
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const [ads, setAds] = useState<Advertisement[] | undefined[]>([]);
|
const [ads, setAds] = useState<Advertisement[] | undefined[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!props.loading && props.data.length > 0) {
|
if (!props.loading && props.data.length > 0) {
|
||||||
console.log(
|
|
||||||
"RRRRRR",
|
|
||||||
props.data[0].placements.includes(props.placement),
|
|
||||||
props.placement
|
|
||||||
);
|
|
||||||
|
|
||||||
const filtered = props.data.filter((a) =>
|
const filtered = props.data.filter((a) =>
|
||||||
a.placements.includes(props.placement)
|
a.placements.includes(props.placement)
|
||||||
);
|
);
|
||||||
|
|
||||||
let temps: Advertisement[] | undefined[] = [];
|
let temps: Advertisement[] | undefined[] = [];
|
||||||
temps[0] = filtered.find((b) => b.placements.includes("top"));
|
temps[0] = filtered.find((b) => b.placements.includes("top"));
|
||||||
temps[1] = filtered.find((b) => b.placements.includes("bottom"));
|
temps[1] = filtered.find((b) => b.placements.includes("bottom"));
|
||||||
setAds(temps);
|
setAds(temps);
|
||||||
console.log("PPPPPP", filtered);
|
|
||||||
}
|
}
|
||||||
}, [props.data, props.loading]);
|
}, [props.data, props.loading, props.placement]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`sticky top-0 space-y-4 ${
|
className={`sticky top-0 space-y-4 ${
|
||||||
props.placement == "left" ? "ml-14" : "mr-14"
|
props.placement === "left" ? "ml-14" : "mr-14"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{props.loading && <p className="text-sm text-gray-500">Loading...</p>}
|
{props.loading && <p className="text-sm text-gray-500">Loading...</p>}
|
||||||
|
|
||||||
{ads?.map(
|
{ads?.map(
|
||||||
(ad) =>
|
(ad) =>
|
||||||
ad && (
|
ad && (
|
||||||
|
<Dialog key={ad.id}>
|
||||||
|
<DialogTrigger asChild>
|
||||||
<img
|
<img
|
||||||
key={ad.id}
|
src={ad.contentFileUrl || ad.imageUrl}
|
||||||
src={ad.contentFileUrl}
|
|
||||||
alt={`Banner ${ad.id}`}
|
alt={`Banner ${ad.id}`}
|
||||||
className="w-full"
|
className="w-full cursor-pointer rounded-lg shadow-md hover:opacity-90 transition"
|
||||||
/>
|
/>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent className="max-w-4xl p-0 bg-transparent border-0 shadow-none">
|
||||||
|
<img
|
||||||
|
src={ad.contentFileUrl || ad.imageUrl}
|
||||||
|
alt={`Banner Besar ${ad.id}`}
|
||||||
|
className="w-full h-auto rounded-lg"
|
||||||
|
/>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -557,9 +557,9 @@
|
||||||
"question1": "WHAT CONTENT IS ON MEDIAHUB AND WHAT CATEGORIES ARE THERE IN IT?",
|
"question1": "WHAT CONTENT IS ON MEDIAHUB AND WHAT CATEGORIES ARE THERE IN IT?",
|
||||||
"answer1": "MediaHub has a variety of content such as news, videos, and documents categorized into topics such as education, entertainment, and current affairs.",
|
"answer1": "MediaHub has a variety of content such as news, videos, and documents categorized into topics such as education, entertainment, and current affairs.",
|
||||||
"question2": "HOW CAN MEDIAHUB CONTENT BE DOWNLOADED?",
|
"question2": "HOW CAN MEDIAHUB CONTENT BE DOWNLOADED?",
|
||||||
"answer2": "You can download content by clicking the download button available on each content on the MediaHub page.",
|
"answer2": "A=) Login first to be able to download B=) Select the photo size you want C=) Click the download button available on each content on the MediaHub page.",
|
||||||
"question3": "WHO CAN REGISTER AS A MEDIAHUB USER?",
|
"question3": "WHO CAN REGISTER AS A MEDIAHUB USER?",
|
||||||
"answer3": "Anyone who has an interest in the content on MediaHub can register as a user, either for personal or professional purposes.",
|
"answer3": "Anyone interested in MediaHub content can register as a user, including individuals and professionals within the General Public, Police, Journalists, and Presidential Staff Office (KSP) categories.",
|
||||||
"question4": "WHAT IS MEDIAHUB? AND WHAT ARE THE FEATURES IN IT?",
|
"question4": "WHAT IS MEDIAHUB? AND WHAT ARE THE FEATURES IN IT?",
|
||||||
"answer4": "MediaHub is a platform that provides various informative and educational content. Key features include search, download, and personalization of content.",
|
"answer4": "MediaHub is a platform that provides various informative and educational content. Key features include search, download, and personalization of content.",
|
||||||
"welcome": "Welcome To",
|
"welcome": "Welcome To",
|
||||||
|
|
|
||||||
|
|
@ -560,9 +560,9 @@
|
||||||
"question1": "APA SAJA KONTEN-KONTEN YANG ADA DI MEDIAHUB DAN KATEGORI DI DALAMNYA?",
|
"question1": "APA SAJA KONTEN-KONTEN YANG ADA DI MEDIAHUB DAN KATEGORI DI DALAMNYA?",
|
||||||
"answer1": "MediaHub memiliki beragam konten seperti berita, video, dan dokumen yang dikategorikan dalam topik seperti edukasi, hiburan, dan informasi terkini.",
|
"answer1": "MediaHub memiliki beragam konten seperti berita, video, dan dokumen yang dikategorikan dalam topik seperti edukasi, hiburan, dan informasi terkini.",
|
||||||
"question2": "BAGAIMANA KONTEN DARI MEDIAHUB DAPAT DIUNDUH?",
|
"question2": "BAGAIMANA KONTEN DARI MEDIAHUB DAPAT DIUNDUH?",
|
||||||
"answer2": "Anda dapat mengunduh konten dengan klik tombol unduh yang tersedia pada setiap konten di halaman MediaHub.",
|
"answer2": "A=) Login terlebih dahulu untuk dapat mengunduh. B=) Pilih size foto yang anda inginkan. C=) Klik tombol unduh yang tersedia pada setiap konten di halaman MediaHub.",
|
||||||
"question3": "SIAPA SAJA YANG DAPAT MENDAFTARKAN DIRI SEBAGAI PENGGUNA MEDIAHUB?",
|
"question3": "SIAPA SAJA YANG DAPAT MENDAFTARKAN DIRI SEBAGAI PENGGUNA MEDIAHUB?",
|
||||||
"answer3": "Semua orang yang memiliki minat terhadap konten di MediaHub dapat mendaftar sebagai pengguna, baik untuk personal maupun profesional.",
|
"answer3": "Semua orang yang memiliki minat terhadap konten di MediaHub dapat mendaftar sebagai pengguna, baik untuk personal maupun profesional yang tergabung dalam kategpri Masyarakat Umum. Anggota Polri, Jurnalis serta KSP",
|
||||||
"question4": "APA ITU MEDIAHUB? DAN APA SAJA FITUR YANG ADA DI DALAMNYA?",
|
"question4": "APA ITU MEDIAHUB? DAN APA SAJA FITUR YANG ADA DI DALAMNYA?",
|
||||||
"answer4": "MediaHub adalah platform yang menyediakan berbagai konten informatif dan edukatif. Fitur utama meliputi pencarian, pengunduhan, dan personalisasi konten.",
|
"answer4": "MediaHub adalah platform yang menyediakan berbagai konten informatif dan edukatif. Fitur utama meliputi pencarian, pengunduhan, dan personalisasi konten.",
|
||||||
"welcome": "Selamat Datang di",
|
"welcome": "Selamat Datang di",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue