import React from 'react' ; import { ApiTokenTypes , ALL } from '../constants' ; import { ApiToken } from '../types' ; export const getEnginesDisplayText = ( apiToken ) : JSX . Element | string => { const { type , access_all_engines : accessAll , engines = [ ] } = apiToken ; if ( type === ApiTokenTypes . Admin ) { return '--' ; } if ( accessAll ) { return ALL ; } return ( < ul > { engines . map ( ( engine ) => ( < li key = { engine } > { engine } < /li>))} < /ul>); } ;