import React from 'react' ; import { useValues } from 'kea' ; import { AppLogic } from '../../app_logic' ; import { EngineLogic } from '../engine' ; import { EmptyEngineOverview } from './engine_overview_empty' ; import { EngineOverviewMetrics } from './engine_overview_metrics' ; export const EngineOverview = ( ) => { const { myRole : { canManageEngineDocuments , canViewEngineCredentials } , } = useValues ( AppLogic ) ; const { hasNoDocuments , isMetaEngine } = useValues ( EngineLogic ) ; const canAddDocuments = canManageEngineDocuments && canViewEngineCredentials ; const showEngineOverview = ! hasNoDocuments || ! canAddDocuments || isMetaEngine ; return showEngineOverview ? < EngineOverviewMetrics /> : <EmptyEngineOverview / > ; } ;