import useStores from 'dbaas/stores/useStores'

import { EmptyPlaceholder } from './components/EmptyPlaceholder'
import { ProjectAdminShell } from './Container/Admin/Shell'
import { ProjectAdminRoutes } from './Container/Routes'

export const ProjectContainer = () => {
  const {
    store: {
      lastVisitLocation: { projectId }
    }
  } = useStores()

  if (!projectId) {
    return <EmptyPlaceholder />
  }

  return (
    <ProjectAdminShell>
      <ProjectAdminRoutes />
    </ProjectAdminShell>
  )
}

export default ProjectContainer
