overleaf/services/web/frontend/js/features/ide-react/components/history.tsx
ilkin-overleaf c39a566fe3 Merge pull request #15221 from overleaf/ii-ide-page-prototype-file-tree-history
FileTree for history React IDE page

GitOrigin-RevId: 56fadced9f507297ba16dc54715811f36dcfd5b5
2023-10-30 09:04:33 +00:00

23 lines
777 B
TypeScript

import { createPortal } from 'react-dom'
import HistoryFileTree from '@/features/history/components/history-file-tree'
import LoadingSpinner from '@/shared/components/loading-spinner'
import { useHistoryContext } from '@/features/history/context/history-context'
export default function History() {
const { updatesInfo } = useHistoryContext()
const fileTreeContainer = document.querySelector('.history-file-tree')
return (
<>
{fileTreeContainer &&
createPortal(<HistoryFileTree />, fileTreeContainer)}
<div className="history-react">
{updatesInfo.loadingState === 'loadingInitial' ? (
<LoadingSpinner />
) : (
'History document diff viewer and versions list placeholder'
)}
</div>
</>
)
}