import React, {FC} from "react"; import {EmulatedButton} from "./EmulatedButton"; import {useAtomValue, useSetAtom} from "jotai"; import {AddNewTreePopupWindowIsOpen, CurrentDashboardSectionIdAtom} from "./atoms"; import {TreeDashboardSection} from "./TreeDashboardSections"; export type NewOfferProps = { } export const NewTreeButton: FC = ({}) => { const openNewTreePopup = useSetAtom(AddNewTreePopupWindowIsOpen) const currentDashboardSection = useAtomValue(CurrentDashboardSectionIdAtom) if (currentDashboardSection !== TreeDashboardSection.Offers) { return } return { openNewTreePopup(true) }}> };