import React from 'react'; import { useTranslation } from 'react-i18next'; import { DropdownMenu, DropdownItem } from 'reactstrap'; import type { LabelType } from '~/interfaces/template'; type DropendMenuProps = { onClickCreateNewPageButtonHandler: () => Promise onClickCreateTodaysButtonHandler: () => Promise onClickTemplateButtonHandler?: (label: LabelType) => Promise todaysPath: string | null, } export const DropendMenu = React.memo((props: DropendMenuProps): JSX.Element => { const { onClickCreateNewPageButtonHandler, onClickCreateTodaysButtonHandler, onClickTemplateButtonHandler, todaysPath, } = props; const { t } = useTranslation('commons'); return ( {t('create_page_dropdown.new_page')} {todaysPath != null && ( <>
  • {t('create_page_dropdown.todays.desc')}
  • {todaysPath} )} { onClickTemplateButtonHandler != null && ( <>
  • {t('create_page_dropdown.template.desc')}
  • onClickTemplateButtonHandler('_template')} > {t('create_page_dropdown.template.children')} onClickTemplateButtonHandler('__template')} > {t('create_page_dropdown.template.descendants')} ) }
    ); }); DropendMenu.displayName = 'DropendMenu';