history-container.tsx 561 B

1234567891011121314151617181920212223
  1. import { useLayoutContext } from '../../../shared/context/layout-context'
  2. import { FullSizeLoadingSpinner } from '../../../shared/components/loading-spinner'
  3. import { lazy, Suspense } from 'react'
  4. const HistoryRoot = lazy(
  5. () => import('@/features/ide-react/components/history-root')
  6. )
  7. function HistoryContainer() {
  8. const { view } = useLayoutContext()
  9. if (view !== 'history') {
  10. return null
  11. }
  12. return (
  13. <Suspense fallback={<FullSizeLoadingSpinner delay={500} />}>
  14. <HistoryRoot />
  15. </Suspense>
  16. )
  17. }
  18. export default HistoryContainer