import { Chip } from "@heroui/chip"; import { FALLBACK_VALUES } from "./constants"; import { EnrichedApiKey, getApiKeyStatus } from "./types"; import { formatRelativeTime, getStatusColor, getStatusLabel } from "./utils"; export const NameCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => (

{apiKey.attributes.name || FALLBACK_VALUES.UNNAMED}

); 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}

);