import { ActionIcon, Group, Menu, Table, Text } from "@mantine/core"; import { IconDots, IconEdit, IconTrash } from "@tabler/icons-react"; import { format } from "date-fns"; import { useTranslation } from "react-i18next"; import { IApiKey } from "@/ee/api-key"; import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import React from "react"; import NoTableResults from "@/components/common/no-table-results"; interface ApiKeyTableProps { apiKeys: IApiKey[]; isLoading?: boolean; showUserColumn?: boolean; onUpdate?: (apiKey: IApiKey) => void; onRevoke?: (apiKey: IApiKey) => void; } export function ApiKeyTable({ apiKeys, isLoading, showUserColumn = false, onUpdate, onRevoke, }: ApiKeyTableProps) { const { t } = useTranslation(); const formatDate = (date: Date | string | null) => { if (!date) return t("Never"); return format(new Date(date), "MMM dd, yyyy"); }; const isExpired = (expiresAt: string | null) => { if (!expiresAt) return false; return new Date(expiresAt) < new Date(); }; return (