import type { FC } from 'react'; import { useHistory } from 'react-router-dom'; import { Menu } from '@servicetitan/anvil2'; import ExpandMoreIcon from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg'; import { SingleActionButtonSection } from './single-action-button'; import { BrandAction } from '../../../utils/interfaces'; export const ActionsButtonSection: FC<{ actions: BrandAction | BrandAction[]; }> = ({ actions }) => { const history = useHistory(); if (!Array.isArray(actions)) { return ; } return ( {actions.map(action => { const actionClick = () => { if (action.action) { action.action(); } if (action.href) { history.push(action.href); } }; return ( ); })} ); };