import { useState } from "react"; import { XCircle } from "lucide-react"; // components import { Tooltip } from "@plane/ui"; import { DeleteApiTokenModal } from "components/api-token"; // ui // helpers import { renderFormattedDate, calculateTimeAgo } from "helpers/date-time.helper"; // types import { IApiToken } from "@plane/types"; type Props = { token: IApiToken; }; export const ApiTokenListItem: React.FC = (props) => { const { token } = props; // states const [deleteModalOpen, setDeleteModalOpen] = useState(false); return ( <> setDeleteModalOpen(false)} tokenId={token.id} />
{token.label}
{token.is_active ? "Active" : "Expired"}
{token.description.trim() !== "" && (

{token.description}

)}

{token.is_active ? token.expired_at ? `Expires ${renderFormattedDate(token.expired_at!)}` : "Never expires" : `Expired ${calculateTimeAgo(token.expired_at)}`}

); };