import { useTranslations } from 'next-intl';

import { FaFacebookF, FaInstagram, FaYoutube } from 'react-icons/fa';

import { cn } from '@/lib/utils';

// The A–Z OPUS channels, each in its brand colour: the icon is coloured, and on hover the
// circle fills with it (Instagram with its gradient) and the icon turns white.
const SOCIAL_LINKS = [
  {
    key: 'facebook',
    href: 'https://www.facebook.com/azopus/',
    Icon: FaFacebookF,
    brand: 'text-[#1877F2] hover:border-[#1877F2] hover:bg-[#1877F2]',
  },
  {
    key: 'youtube',
    href: 'https://www.youtube.com/@az_opus/featured',
    Icon: FaYoutube,
    brand: 'text-[#FF0000] hover:border-[#FF0000] hover:bg-[#FF0000]',
  },
  {
    key: 'instagram',
    href: 'https://www.instagram.com/az_opus/',
    Icon: FaInstagram,
    brand:
      'text-[#E4405F] bg-origin-border hover:border-transparent hover:bg-[radial-gradient(circle_at_30%_107%,#FDF497_0%,#FDF497_5%,#FD5949_45%,#D6249F_60%,#285AEB_90%)]',
  },
] as const;

/** The A–Z OPUS social channels as icon links: on the dark footer, or in the light mobile menu. */
export default function SocialLinks({
  tone = 'dark',
  className,
}: {
  tone?: 'dark' | 'light';
  className?: string;
}) {
  const t = useTranslations('footer');
  return (
    <ul className={cn('flex gap-2', className)}>
      {SOCIAL_LINKS.map(({ key, href, Icon, brand }) => (
        <li key={key}>
          <a
            href={href}
            target="_blank"
            rel="noopener noreferrer"
            title={t(key)}
            aria-label={t(key)}
            className={cn(
              'flex size-10 items-center justify-center rounded-full border text-base transition hover:text-white',
              tone === 'dark' ? 'border-white/15 bg-white/5' : 'border-[#151720]/15 bg-white',
              brand
            )}
          >
            <Icon aria-hidden />
          </a>
        </li>
      ))}
    </ul>
  );
}
