overleaf/services/web/frontend/js/features/ide-react/context/review-panel/review-panel-provider.tsx
Alf Eaton 749660e168 Refactor review panel context (#17383)
GitOrigin-RevId: 23e7ff8632172ebd0bc544a2297d1d4179010832
2024-03-07 16:30:25 +00:00

19 lines
658 B
TypeScript

import useReviewPanelState from '@/features/ide-react/context/review-panel/hooks/use-review-panel-state'
import {
ReviewPanelUpdaterFnsContext,
ReviewPanelValueContext,
} from '@/features/source-editor/context/review-panel/review-panel-context'
const ReviewPanelReactIdeProvider: React.FC = ({ children }) => {
const { values, updaterFns } = useReviewPanelState()
return (
<ReviewPanelValueContext.Provider value={values}>
<ReviewPanelUpdaterFnsContext.Provider value={updaterFns}>
{children}
</ReviewPanelUpdaterFnsContext.Provider>
</ReviewPanelValueContext.Provider>
)
}
export default ReviewPanelReactIdeProvider