import React from 'react' ; import { Route , Switch } from 'react-router-dom' ; import { useValues } from 'kea' ; import { ENGINE_REINDEX_JOB_PATH } from '../../routes' ; import { EngineLogic } from '../engine' ; import { ReindexJob } from './reindex_job' ; import { Schema , MetaEngineSchema } from './views' ; export const SchemaRouter = ( ) => { const { isMetaEngine } = useValues ( EngineLogic ) ; return ( < Switch > < Route path = { ENGINE_REINDEX_JOB_PATH } > < ReindexJob /> < /Route> < Route > { isMetaEngine ? < MetaEngineSchema / > : < Schema />}</Route > < /Switch>); } ;