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}
{apiKey.attributes.prefix}
);
export const DateCell = ({ date }: { date: string | null }) => (
{formatRelativeTime(date)}
); export const LastUsedCell = ({ apiKey }: { apiKey: EnrichedApiKey }) => ({apiKey.userEmail}
);