import { librariesRoutes } from 'src/pages/dashboard/libraries/routes';
import { CopyTypePath } from 'src/types/deeplinks';
import { useLokaliseTranslation } from 'src/utils/i18n';

import CopyUrlMenuItem from 'src/components/deeplinks/CopyUrlMenuItem';
import MoreMenu from 'src/components/deeplinks/MoreMenu';

export type ArticleMenuProps = {
  id: number;
};

export const ArticleMenu = ({ id }: ArticleMenuProps) => {
  const { t } = useLokaliseTranslation('libraries');

  const menuOptions = [
    {
      id: 'copy-url',
      enabled: true,
      option: (
        <CopyUrlMenuItem
          type={CopyTypePath.LIBRARY_ARTICLE}
          route={librariesRoutes.library(id)}
        />
      ),
    },
  ];

  return (
    <MoreMenu
      id={`library-${id}`}
      label={t('library.menu')}
      menuOptions={menuOptions}
    />
  );
};

export default ArticleMenu;
