'use client';

import { localizedPath, routeIdFromPathname, type Locale } from '@/lib/localization/config';
import Image from 'next/image';
import { usePathname } from 'next/navigation';
import styles from './SiteHeader.module.css';

export function BrandLink({ locale, label }: { locale: Locale; label: string }) {
  const pathname = usePathname();
  return (
    <a
      className={styles.brand}
      href={localizedPath('home', locale)}
      aria-label={label}
      aria-current={routeIdFromPathname(pathname) === 'home' ? 'page' : undefined}
    >
      <Image
        src="/rentaldrivego.png"
        alt=""
        width={36}
        height={36}
        className={styles.mark}
        priority
        unoptimized
      />
      <span className={styles.brandName}>RentalDriveGo</span>
    </a>
  );
}
