mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-26 13:22:06 +00:00
Move error boundary inside history container GitOrigin-RevId: cd4c911cef18b50cd4187f655e818c9ab851cfe0
23 lines
561 B
TypeScript
23 lines
561 B
TypeScript
import { useLayoutContext } from '../../../shared/context/layout-context'
|
|
import { FullSizeLoadingSpinner } from '../../../shared/components/loading-spinner'
|
|
import { lazy, Suspense } from 'react'
|
|
|
|
const HistoryRoot = lazy(
|
|
() => import('@/features/ide-react/components/history-root')
|
|
)
|
|
|
|
function HistoryContainer() {
|
|
const { view } = useLayoutContext()
|
|
|
|
if (view !== 'history') {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<Suspense fallback={<FullSizeLoadingSpinner delay={500} />}>
|
|
<HistoryRoot />
|
|
</Suspense>
|
|
)
|
|
}
|
|
|
|
export default HistoryContainer
|