import { useCallback } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import type { RequireExactlyOne } from "type-fest"; import { Icon, Icons } from "@/components/Icon"; import { BrandPill } from "@/components/layout/BrandPill"; import { WideContainer } from "@/components/layout/WideContainer"; import { shouldHaveDmcaPage } from "@/pages/Dmca"; import { conf } from "@/setup/config"; // to and href are mutually exclusive type FooterLinkProps = RequireExactlyOne< { children: React.ReactNode; icon: Icons; to: string; href: string; }, "to" | "href" >; function FooterLink(props: FooterLinkProps) { const navigate = useNavigate(); const navigateTo = useCallback(() => { if (!props.to) return; navigate(props.to); }, [navigate, props.to]); return ( {props.children} ); } function Dmca() { const { t } = useTranslation(); if (!shouldHaveDmcaPage()) return null; if (window.location.hash === "#/dmca") return null; return ( {t("footer.links.dmca")} ); } export function Footer() { const { t } = useTranslation(); return ( ); } export function FooterView(props: { children: React.ReactNode; className?: string; }) { return (
{props.children}
); }