import { Clock } from 'lucide-react';
import { t } from '@/i18n';
import { cn } from '@/lib/cn';
import { formatDate, freshnessLevel, relativeFreshness } from '@/lib/format';
import type { ObservationStatus } from '@/lib/types';
/** Small retrieval-freshness chip: "Updated 3 d ago" with a colour + icon (never colour alone). */
export function FreshnessBadge({ retrievedAt, now, className }: { retrievedAt: string | null | undefined; now?: number; className?: string }) {
const level = freshnessLevel(retrievedAt, now);
if (!level) return null;
return (
{t('common.freshness.updated', { when: relativeFreshness(retrievedAt, now) })}
);
}
export function StatusBadge({ status }: { status: ObservationStatus }) {
const label = t(`common.status.${status}` as const);
return (
{label}
);
}