'use client';

import { localizedPath, routeIdFromPathname, type Locale } from '@/lib/localization/config';
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}
    >
      <span aria-hidden="true" className={styles.mark}>
        RDG
      </span>
      <span className={styles.brandName}>RentalDriveGo</span>
    </a>
  );
}
