"use client"

import { searchResultsTitle, type DriveSearchState } from "@/lib/drive/drive-search"
import { cn } from "@/lib/utils"

const CRUMB_LINE_CLASS = "leading-6 md:leading-7"

export function DriveSearchBreadcrumb({ search }: { search: DriveSearchState }) {
  return (
    <nav
      aria-label="Résultats de recherche"
      className="flex min-w-0 flex-nowrap items-center overflow-hidden text-[#5f6368] dark:text-muted-foreground"
    >
      <span
        className={cn(
          "min-w-0 truncate text-base font-normal tracking-tight text-[#202124] md:text-[1.375rem] dark:text-foreground",
          CRUMB_LINE_CLASS
        )}
        title={searchResultsTitle(search)}
      >
        {searchResultsTitle(search)}
      </span>
    </nav>
  )
}
