2024-12-10 13:51:14 +00:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import Link from "next/link";
|
|
|
|
|
import React, { useEffect, useState } from "react";
|
|
|
|
|
import { generateLocalizedPath } from "@/utils/globals";
|
|
|
|
|
import { useParams, usePathname, useRouter } from "next/navigation";
|
2025-02-03 14:40:26 +00:00
|
|
|
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
2024-12-10 13:51:14 +00:00
|
|
|
import { getPrivacy } from "@/service/landing/landing";
|
|
|
|
|
import parse from "html-react-parser";
|
2025-02-03 14:40:26 +00:00
|
|
|
import { useTranslations } from "next-intl";
|
|
|
|
|
import NewsTicker from "./news-tickers";
|
2024-11-28 15:21:06 +00:00
|
|
|
|
|
|
|
|
const Footer = () => {
|
2024-12-10 13:51:14 +00:00
|
|
|
const router = useRouter();
|
|
|
|
|
const pathname = usePathname();
|
|
|
|
|
const params = useParams();
|
|
|
|
|
const locale = params?.locale;
|
|
|
|
|
const [privacy, setPrivacy] = useState();
|
2025-02-03 14:40:26 +00:00
|
|
|
const t = useTranslations("LandingPage");
|
2024-12-10 13:51:14 +00:00
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
async function initState() {
|
|
|
|
|
const response = await getPrivacy();
|
2025-01-05 00:44:55 +00:00
|
|
|
setPrivacy(response?.data?.data.htmlContent);
|
2024-12-10 13:51:14 +00:00
|
|
|
}
|
|
|
|
|
initState();
|
|
|
|
|
}, []);
|
|
|
|
|
|
2024-11-28 15:21:06 +00:00
|
|
|
return (
|
2025-02-03 14:40:26 +00:00
|
|
|
<footer className="bg-[#bb3523] text-white text-xs lg:text-sm py-4 space-y-3 lg:space-y-0 h-">
|
2025-04-06 13:26:35 +00:00
|
|
|
<div className="mx-auto flex flex-col md:flex-row justify-between items-center px-4 gap-3">
|
2024-11-28 15:21:06 +00:00
|
|
|
{/* Hak Cipta */}
|
2025-02-03 14:40:26 +00:00
|
|
|
<div className="text-center md:text-left">
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("copyright", { defaultValue: "Copyright" })} © {new Date().getFullYear()}{" "}
|
|
|
|
|
{t("publicRelation", { defaultValue: "Public Relation" })} {t("reserved", { defaultValue: "Reserved" })}
|
2025-02-03 14:40:26 +00:00
|
|
|
</div>
|
2024-11-28 15:21:06 +00:00
|
|
|
|
|
|
|
|
{/* Menu Links */}
|
|
|
|
|
<div className="flex flex-wrap justify-center items-center space-x-3">
|
2025-04-06 13:26:35 +00:00
|
|
|
<Link
|
|
|
|
|
href={generateLocalizedPath("/feedback", String(locale))}
|
|
|
|
|
className="hover:underline"
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("feedback", { defaultValue: "Feedback" })}
|
2024-12-10 13:51:14 +00:00
|
|
|
</Link>
|
|
|
|
|
<span className="hidden md:inline-block ">|</span>
|
2025-04-06 13:26:35 +00:00
|
|
|
<Link
|
|
|
|
|
href={generateLocalizedPath("/contact", String(locale))}
|
|
|
|
|
className="hover:underline"
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("contact", { defaultValue: "Contact" })}
|
2024-12-10 13:51:14 +00:00
|
|
|
</Link>
|
2024-11-28 15:21:06 +00:00
|
|
|
<span className="hidden md:inline-block">|</span>
|
2025-04-06 13:26:35 +00:00
|
|
|
<Link
|
|
|
|
|
href={generateLocalizedPath("/faqs", String(locale))}
|
|
|
|
|
className="hover:underline"
|
|
|
|
|
>
|
2024-11-28 15:21:06 +00:00
|
|
|
FAQ
|
2024-12-10 13:51:14 +00:00
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
<Dialog>
|
|
|
|
|
<DialogTrigger>
|
|
|
|
|
<span className="hidden md:inline-block">|</span>
|
2024-12-20 15:52:53 +00:00
|
|
|
<a href="#" className="hover:underline px-2">
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("privacy", { defaultValue: "Privacy" })}
|
2024-12-10 13:51:14 +00:00
|
|
|
</a>
|
|
|
|
|
</DialogTrigger>
|
2025-04-06 13:26:35 +00:00
|
|
|
<DialogContent
|
|
|
|
|
className="flex flex-col overflow-y-scroll h-[80%]"
|
|
|
|
|
size="md"
|
2025-06-08 06:17:11 +00:00
|
|
|
data-lenis-prevent
|
2025-04-06 13:26:35 +00:00
|
|
|
>
|
2024-12-10 13:51:14 +00:00
|
|
|
<div className="flex flex-row items-center justify-center gap-4">
|
|
|
|
|
<img src="/assets/icon-privacy.png" alt="Privacy" />
|
2025-07-06 09:23:45 +00:00
|
|
|
<p className="font-semibold text-lg">{t("privacy", { defaultValue: "Privacy" })}</p>
|
2024-12-10 13:51:14 +00:00
|
|
|
</div>
|
2025-04-06 13:26:35 +00:00
|
|
|
<div className="container text-black dark:text-white space-y-2">
|
|
|
|
|
{parse(String(privacy))}
|
|
|
|
|
</div>
|
2024-12-10 13:51:14 +00:00
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
2024-11-28 15:21:06 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Social Media Icons */}
|
|
|
|
|
<div className="flex justify-center items-center space-x-3">
|
|
|
|
|
<span className="text-sm">Follow Us:</span>
|
|
|
|
|
<a href="#" aria-label="Facebook">
|
2025-04-06 13:26:35 +00:00
|
|
|
<img
|
|
|
|
|
src="/assets/facebook.svg"
|
|
|
|
|
alt="Facebook"
|
|
|
|
|
className="w-5 h-5"
|
|
|
|
|
/>
|
2024-11-28 15:21:06 +00:00
|
|
|
</a>
|
|
|
|
|
<a href="#" aria-label="Instagram">
|
2025-04-06 13:26:35 +00:00
|
|
|
<img
|
|
|
|
|
src="/assets/instagram.svg"
|
|
|
|
|
alt="Instagram"
|
|
|
|
|
className="w-5 h-5"
|
|
|
|
|
/>
|
2024-11-28 15:21:06 +00:00
|
|
|
</a>
|
|
|
|
|
<a href="#" aria-label="Twitter">
|
2025-04-06 13:26:35 +00:00
|
|
|
<img
|
|
|
|
|
src="/assets/twitter.svg"
|
|
|
|
|
alt="Instagram"
|
|
|
|
|
className="w-5 h-5"
|
|
|
|
|
/>
|
2024-11-28 15:21:06 +00:00
|
|
|
</a>
|
|
|
|
|
<a href="#" aria-label="TikTok">
|
|
|
|
|
<img src="/assets/tiktok.svg" alt="TikTok" className="w-5 h-5" />
|
|
|
|
|
</a>
|
|
|
|
|
<a href="#" aria-label="YouTube">
|
|
|
|
|
<img src="/assets/youtube.svg" alt="YouTube" className="w-5 h-5" />
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</footer>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Footer;
|