2023-10-27 06:50:57 -04:00
|
|
|
import { createPortal } from 'react-dom'
|
|
|
|
import HistoryFileTree from '@/features/history/components/history-file-tree'
|
|
|
|
import LoadingSpinner from '@/shared/components/loading-spinner'
|
2023-10-30 06:09:46 -04:00
|
|
|
import DiffView from '@/features/history/components/diff-view/diff-view'
|
|
|
|
import ChangeList from '@/features/history/components/change-list/change-list'
|
2023-10-27 06:50:57 -04:00
|
|
|
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 />
|
|
|
|
) : (
|
2023-10-30 06:09:46 -04:00
|
|
|
<>
|
|
|
|
<DiffView />
|
|
|
|
<ChangeList />
|
|
|
|
</>
|
2023-10-27 06:50:57 -04:00
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|