import React, { useEffect, useState } from "react"; import { useRouter } from "next/router"; import { faX } from "@fortawesome/free-solid-svg-icons"; import { reverseEnvMapping } from "../../../public/data/frequentConstants"; import guidGenerator from "../../utilities/randomId"; import Button from "../buttons/Button"; /** * This is the component that we utilize for the user table - in future, can reuse it for some other purposes too. * #TODO: add the possibility of choosing and doing operations on multiple users. * @param {*} props * @returns */ const ServiceTokenTable = ({ data, workspaceName }) => { const router = useRouter(); return (
{data?.length > 0 ? ( data.map((row, index) => { return ( ); }) ) : ( )}
Token name Project Environment Valid until
{row.name} {workspaceName} {reverseEnvMapping[row.environment]} {new Date(row.expiresAt).toUTCString()}
No service tokens yet
); }; export default ServiceTokenTable;