import React, { FC } from 'react'; import toastr from 'toastr'; import { useTranslation } from 'react-i18next'; import { IPageHasId } from '~/interfaces/page'; type PageItemControlProps = { page: Partial isEnableActions: boolean isDeletable: boolean onClickDeleteButton?: (pageId: string) => void } const PageItemControl: FC = (props: PageItemControlProps) => { const { page, isEnableActions, onClickDeleteButton, isDeletable, } = props; const { t } = useTranslation(''); const deleteButtonHandler = () => { if (onClickDeleteButton != null && page._id != null) { onClickDeleteButton(page._id); } }; return ( <>
{/* TODO: if there is the following button in XD add it here */} {/* TODO: add function to the following buttons like using modal or others ref: https://estoc.weseek.co.jp/redmine/issues/79026 */} {/* TODO: show dropdown when permalink section is implemented */} {!isEnableActions &&

{t('search_result.currently_not_implemented')}

} {isEnableActions && ( )} {isEnableActions && ( )} {isEnableActions && ( )} {isDeletable && isEnableActions && ( <>
)}
); }; export default PageItemControl;