import Link from "next/link"; // helpers import { formatLongDateDistance, timeAgo } from "helpers/date-time.helper"; // icons import { XCircle } from "lucide-react"; import { IApiToken } from "types/api_token"; interface IApiTokenListItem { workspaceSlug: string | string[] | undefined; token: IApiToken; } export const ApiTokenListItem = ({ token, workspaceSlug }: IApiTokenListItem) => (
{token.label} {token.is_active ? "Active" : "Expired"}
{token.description.length != 0 && (

{token.description}

)} {

{token.is_active ? token.expired_at === null ? "Never Expires" : `Expires in ${formatLongDateDistance(token.expired_at!)}` : timeAgo(token.expired_at)}

}
);