import React , { useEffect } from 'react' ; import { useParams } from 'react-router-dom' ; import { useValues , useActions } from 'kea' ; import { EnterpriseSearchPageTemplate } from '../../../../shared/layout' ; import { AutomatedCuration } from './automated_curation' ; import { CurationLogic } from './curation_logic' ; import { ManualCuration } from './manual_curation' ; export const Curation = ( ) => { const { curationId } = useParams ( ) as { curationId : string ; } ; const { loadCuration } = useActions ( CurationLogic ( { curationId } ) ) ; const { dataLoading , isAutomated } = useValues ( CurationLogic ( { curationId } ) ) ; useEffect ( ( ) => { loadCuration ( ) ; } , [ curationId ] ) ; if ( dataLoading ) { return < EnterpriseSearchPageTemplate isLoading / > ; } return isAutomated ? < AutomatedCuration /> : <ManualCuration / > ; } ;