import { Badge, Tooltip, TooltipContent, TooltipTrigger, } from "@/components/shadcn"; import { FALLBACK_VALUES } from "./constants"; import { EnrichedApiKey, getApiKeyStatus } from "./types"; import { formatRelativeTime, getStatusColor, getStatusLabel } from "./utils"; // Maps HeroUI status colors to shadcn Badge variants const STATUS_BADGE_VARIANT = { success: "success", danger: "error", warning: "warning", } as const; export const NameCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => { const name = apiKey.attributes.name || FALLBACK_VALUES.UNNAMED; return (

{name}

{name}
); }; export const PrefixCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => ( {apiKey.attributes.prefix} ); export const DateCell = ({ date }: { date: string | null }) => (

{formatRelativeTime(date)}

); export const LastUsedCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => ( ); export const StatusCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => { const status = getApiKeyStatus(apiKey); return ( {getStatusLabel(status)} ); }; export const EmailCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => (

{apiKey.userEmail}

);