import React, {FC, PropsWithChildren} from "react"; import {useNavigationActions} from "./tree/hooks"; import {PopupWindowProps, ScreenNavigation} from "./PopupWindow"; export type PopupWindowContentProps = { height: number, content: (args: { height: number, width?: number, screenNavigation: ReturnType, close: PopupWindowProps['onClose'] }) => React.ReactNode, width?: number, onClose: PopupWindowProps['onClose'] } & ScreenNavigation export const PopupWindowContent: FC = ({ height, width, content, screenId, setCurrentScreenId, onClose }) => { const screenNavigation = useNavigationActions(screenId, setCurrentScreenId) return <>{content({height, width, screenNavigation, close: onClose})} }