"use client" import type { CertificateView } from "@/lib/certificate-view" import { cn } from "@/lib/utils" function daysLeftColor(days: number | null): string { if (days === null) return "text-muted-foreground" if (days <= 7) return "text-destructive" if (days <= 30) return "text-warning" return "text-success" } export function CertDaysCell({ cert }: { cert: CertificateView }) { return (
{cert.daysLeft === null ? "Срок неизвестен" : cert.daysLeft < 0 ? "Истёк " + -cert.daysLeft + "д назад" : cert.daysLeft + "д осталось"} {cert.validUntil ?? "Дата окончания неизвестна"}
) }