"use client";

import { ReactNode } from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import styles from "./Footer.module.css";

type Props = {
    href: string;
    children: ReactNode;
};

const FooterClickable = ({ children, href }: Props) => {
    const pathname = usePathname();

    return (
        <Link
            href={href}
            className={styles.link}
            data-active={pathname === href || undefined}>
            {children}
        </Link>
    );
};

export default FooterClickable;
