import React from 'react' ; import { EuiIcon } from '@elastic/eui' ; import { REPOSITORY_TYPES } from '../../../common/constants' ; import { RepositoryType } from '../../../common/types' ; interface Props { type : RepositoryType ; [ key ] : any ; } export const RepositoryTypeLogo = ( { type , ... rest } ) => { const typeLogoMap = { [ REPOSITORY_TYPES . fs ] : 'storage' , [ REPOSITORY_TYPES . url ] : 'eye' , [ REPOSITORY_TYPES . azure ] : 'logoAzure' , [ REPOSITORY_TYPES . gcs ] : 'logoGCP' , [ REPOSITORY_TYPES . hdfs ] : 'logoApache' , [ REPOSITORY_TYPES . s3 ] : 'logoAWS' , } ; return < EuiIcon type = { typeLogoMap [ type ] || 'folderOpen' } { ... rest } />; } ;