'use client';

import { useRelativeTimeLabel } from '@/lib/hooks/useRelativeTimeLabel';
import type { Locale } from '@/lib/i18n';

interface RelativeTimeCellProps {
  date: Date | string | null | undefined;
  locale: Locale;
  className?: string;
}

export function RelativeTimeCell({ date, locale, className }: RelativeTimeCellProps) {
  const label = useRelativeTimeLabel(date, locale);
  if (className) {
    return <span className={className}>{label}</span>;
  }
  return <>{label}</>;
}
