'use client';

import Link from 'next/link'
import React from 'react'
import type { LinkProps } from 'next/link'
import { usePathname } from 'next/navigation'
import clsx from 'clsx'

type Props = {
  icon: React.ReactElement
  value: string
} & LinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement>

function BottomNavHighlightLink({ icon, value, href, ...restProps }: Props) {
  const pathname = usePathname();
  const isActive = pathname === href;

  return (
    <Link {...restProps} href={href} className={clsx(
      'flex flex-col justify-arround items-center gap-[5px] text-primary pointer-events-auto',
      restProps.className ?? '',
    )}>
      <div className={clsx(
        'bg-primary text-primary-foreground p-3.5 rounded-full',
      )}>
        {icon}
      </div>
      <span className="text-xs2 dark:text-white">
        {value}
      </span>
    </Link>
  )
}

export default BottomNavHighlightLink
