"use client"

import { formatDriveListDate } from "@/lib/drive/drive-date"
import { cn } from "@/lib/utils"

export function DriveListModified({
  iso,
  className,
}: {
  iso: string
  className?: string
}) {
  const { short, full, dateTime } = formatDriveListDate(iso)

  if (!full) {
    return (
      <span className={cn("text-sm text-muted-foreground", className)}>—</span>
    )
  }

  return (
    <time
      dateTime={dateTime}
      title={full}
      aria-label={full}
      className={cn("text-sm text-muted-foreground", className)}
    >
      {short}
    </time>
  )
}
