import React from "react"; import { Flex, Box, Text } from "rebass"; import { useStore as useUserStore } from "../../stores/user-store"; function Menu(props) { const isTrial = useUserStore( (store) => store.user?.notesnook?.subscription?.isTrial ); return ( Properties {props.menuItems.map( (item) => item.visible !== false && ( { e.stopPropagation(); if (props.closeMenu) { props.closeMenu(); } item.onClick(props.data); }} flexDirection="row" alignItems="center" justifyContent="space-between" py={"8px"} px={3} sx={{ color: item.color || "text", cursor: "pointer", ":hover": { backgroundColor: "shade", }, }} > {item.component ? ( ) : ( {item.title} )} {item.onlyPro && isTrial === undefined && ( Pro )} ) )} ); } export default Menu;