mediahub-fe/components/landing-page/footer.tsx

121 lines
4.2 KiB
TypeScript
Raw Permalink Normal View History

"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";
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 = () => {
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");
useEffect(() => {
async function initState() {
const response = await getPrivacy();
2025-01-05 00:44:55 +00:00
setPrivacy(response?.data?.data.htmlContent);
}
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">
{t("copyright", { defaultValue: "Copyright" })} &copy; {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"
>
{t("feedback", { defaultValue: "Feedback" })}
</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"
>
{t("contact", { defaultValue: "Contact" })}
</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
</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">
{t("privacy", { defaultValue: "Privacy" })}
</a>
</DialogTrigger>
2025-04-06 13:26:35 +00:00
<DialogContent
className="flex flex-col overflow-y-scroll h-[80%]"
size="md"
data-lenis-prevent
2025-04-06 13:26:35 +00:00
>
<div className="flex flex-row items-center justify-center gap-4">
<img src="/assets/icon-privacy.png" alt="Privacy" />
<p className="font-semibold text-lg">{t("privacy", { defaultValue: "Privacy" })}</p>
</div>
2025-04-06 13:26:35 +00:00
<div className="container text-black dark:text-white space-y-2">
{parse(String(privacy))}
</div>
</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;