mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
7db5d761ea
Review panel track changes for React IDE page GitOrigin-RevId: d061596581ff10bd897b286dcd5c280ce79a6384
23 lines
916 B
TypeScript
23 lines
916 B
TypeScript
import { createContext } from 'react'
|
|
import useReviewPanelState from '@/features/ide-react/context/review-panel/hooks/use-review-panel-state'
|
|
import { ReviewPanelStateReactIde } from '@/features/ide-react/context/review-panel/types/review-panel-state'
|
|
|
|
export const ReviewPanelReactIdeValueContext = createContext<
|
|
ReviewPanelStateReactIde['values'] | undefined
|
|
>(undefined)
|
|
|
|
export const ReviewPanelReactIdeUpdaterFnsContext = createContext<
|
|
ReviewPanelStateReactIde['updaterFns'] | undefined
|
|
>(undefined)
|
|
|
|
export const ReviewPanelReactIdeProvider: React.FC = ({ children }) => {
|
|
const { values, updaterFns } = useReviewPanelState()
|
|
|
|
return (
|
|
<ReviewPanelReactIdeValueContext.Provider value={values}>
|
|
<ReviewPanelReactIdeUpdaterFnsContext.Provider value={updaterFns}>
|
|
{children}
|
|
</ReviewPanelReactIdeUpdaterFnsContext.Provider>
|
|
</ReviewPanelReactIdeValueContext.Provider>
|
|
)
|
|
}
|