import React, {FC} from "react"; import {PopupWindow} from "../PopupWindow"; import {ExamplesPopupWindowStateAtom, getDefaultClosedExamplesPopupWindowState} from "./atoms"; import {useAtom} from "jotai"; import {useScreenNavigation} from "./hooks"; import {__} from "../globals"; export type ExamplesPopupWindowProps = {} /** * Do ont put this in the same file as the Testable popup window because on update this will update too causing nasty bugs */ export const ExamplesPopupWindow: FC = ({}) => { const [{isOpen, context}, setExamplesPopupState] = useAtom(ExamplesPopupWindowStateAtom) const [currentScreenId, setCurrentScreenId] = useScreenNavigation() const closePopup = () => setExamplesPopupState(getDefaultClosedExamplesPopupWindowState()) return null, description: undefined, content: () => { return `this are the examples for the id: ${context.id}` }, showBottomNavigation: true, primaryBottom: () => ({ label: __('OK'), onClick: closePopup, }) }, ]} isOpen={isOpen} onClose={closePopup} /> }