import { h } from 'preact'; import { useCallback } from 'preact/hooks'; import { ButtonNew as Button, Icon } from '@crayons'; import Close from '@images/x.svg'; /** * Higher-order component that returns a template responsible for the layout of * a selected location * * @returns {h.JSX.ElementType} */ export const SelectedLocation = ({ displayName, onNameClick, label, ExtraInfo, }) => { const Template = ({ onEdit: _, onDeselect, ...location }) => { const onClick = useCallback(() => onNameClick(location), [location]); return (
); }; Template.displayName = displayName; return Template; };