import { useState } from "react"; import { XCircle } from "lucide-react"; // components import { DeleteApiTokenModal } from "components/api-token"; // ui import { Tooltip } from "@plane/ui"; // helpers import { renderFormattedDate, timeAgo } from "helpers/date-time.helper"; // types import { IApiToken } from "types/api_token"; 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 ${timeAgo(token.expired_at)}`}

); };