import { Copy } from "lucide-react"; // hooks import useToast from "hooks/use-toast"; // ui import { Button, Tooltip } from "@plane/ui"; // helpers import { renderFormattedDate } from "helpers/date-time.helper"; import { copyTextToClipboard } from "helpers/string.helper"; // types import { IApiToken } from "@plane/types"; type Props = { handleClose: () => void; tokenDetails: IApiToken; }; export const GeneratedTokenDetails: React.FC = (props) => { const { handleClose, tokenDetails } = props; const { setToastAlert } = useToast(); const copyApiToken = (token: string) => { copyTextToClipboard(token).then(() => setToastAlert({ type: "success", title: "Success!", message: "Token copied to clipboard.", }) ); }; return (

Key created

Copy and save this secret key in Plane Pages. You can{"'"}t see this key after you hit Close. A CSV file containing the key has been downloaded.

{tokenDetails.expired_at ? `Expires ${renderFormattedDate(tokenDetails.expired_at)}` : "Never expires"}

); };