import dayjs from 'dayjs' import { Badge, TableCell } from 'ui' import { TimestampInfo } from 'ui-patterns/TimestampInfo' interface TokenNameCellProps { name: string tokenAlias: string isClassic: boolean scopedTokensEnabled?: boolean } export const TokenNameCell = ({ name, tokenAlias, isClassic, scopedTokensEnabled, }: TokenNameCellProps) => (

{name}

{isClassic && scopedTokensEnabled && Legacy}

{tokenAlias}

) interface LastUsedCellProps { lastUsedAt: string | null | undefined } export const LastUsedCell = ({ lastUsedAt }: LastUsedCellProps) => ( {lastUsedAt ? ( ) : (

Never used

)}
) interface ExpiresCellProps { expiresAt: string | null | undefined } export const ExpiresCell = ({ expiresAt }: ExpiresCellProps) => ( {expiresAt ? ( dayjs(expiresAt).isBefore(dayjs()) ? ( ) : ( ) ) : (

Never

)}
)