import React from 'react';
import { Menu, MenuItem, Typography } from '@mui/material';
import { useTranslation } from 'react-i18next';

interface ParserContextMenuProps {
  anchorEl: HTMLElement | null;
  open: boolean;
  onClose: () => void;
  onOpenParser: () => void;
  onOpenMetadata: () => void;
}

export default function ParserContextMenu({
  anchorEl,
  open,
  onClose,
  onOpenParser,
  onOpenMetadata,
}: ParserContextMenuProps) {
  const { t } = useTranslation();

  return (
    <Menu anchorEl={anchorEl} open={open} onClose={onClose}>
      <MenuItem onClick={() => { onOpenParser(); }}>
        <Typography>{t('knowledgeDetails.dataPipeline')}</Typography>
      </MenuItem>
      <MenuItem onClick={() => { onOpenMetadata(); }}>
        <Typography>{t('knowledgeDetails.setMetaData')}</Typography>
      </MenuItem>
    </Menu>
  );
}