import Stack from '@material-hu/mui/Stack';

import { useLokaliseTranslation as useTranslation } from 'src/utils/i18n';

import { MoreMenu } from 'src/components/deeplinks/MoreMenu';

import { MenuOption } from '../../timeOff/components/shared/GenericMenu';

type GenericPostMenuProps = {
  id: number;
  menuOptions: MenuOption[];
};

export const GenericPostMenu = ({ id, menuOptions }: GenericPostMenuProps) => {
  const { t } = useTranslation(['post']);

  return (
    <Stack sx={{ flexDirection: 'row', alignItems: 'center' }}>
      <MoreMenu
        menuProps={{
          fixedDimensions: false,
        }}
        id={`post-${id}`}
        label={t('post:post_menu')}
        menuOptions={menuOptions}
        size="large"
      />
    </Stack>
  );
};
