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

93 lines
3.6 KiB
TypeScript
Raw 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-">
<div className="mx-auto flex flex-col md:flex-row justify-between items-center px-4">
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")} &copy; {new Date().getFullYear()} {t("publicRelation")} {t("reserved")}
</div>
2024-11-28 15:21:06 +00:00
{/* Menu Links */}
<div className="flex flex-wrap justify-center items-center space-x-3">
<Link href={generateLocalizedPath("/feedback", String(locale))} className="hover:underline">
2025-02-03 14:40:26 +00:00
{t("feedback")}
</Link>
<span className="hidden md:inline-block ">|</span>
<Link href={generateLocalizedPath("/contact", String(locale))} className="hover:underline">
2025-02-03 14:40:26 +00:00
{t("contact")}
</Link>
2024-11-28 15:21:06 +00:00
<span className="hidden md:inline-block">|</span>
<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">
2025-02-03 14:40:26 +00:00
{t("privacy")}
</a>
</DialogTrigger>
<DialogContent className="flex flex-col overflow-y-scroll h-[80%]" size="md">
<div className="flex flex-row items-center justify-center gap-4">
<img src="/assets/icon-privacy.png" alt="Privacy" />
2025-02-03 14:40:26 +00:00
<p className="font-semibold text-lg">{t("privacy")}</p>
</div>
2025-02-18 06:02:40 +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">
<img src="/assets/facebook.svg" alt="Facebook" className="w-5 h-5" />
</a>
<a href="#" aria-label="Instagram">
<img src="/assets/instagram.svg" alt="Instagram" className="w-5 h-5" />
</a>
<a href="#" aria-label="Twitter">
<img src="/assets/twitter.svg" alt="Instagram" className="w-5 h-5" />
</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;