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