import React, { useMemo } from 'react'; import classNames from 'classnames'; import { ConfigurableLink } from '@openmrs/esm-framework'; import { BrowserRouter, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; export interface DashboardLinkConfig { name: string; title: string; } function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) { const { t } = useTranslation(); const { name } = dashboardLinkConfig; const location = useLocation(); const spaBasePath = `${window.spaBase}/home`; const navLink = useMemo(() => { const pathArray = location.pathname.split('/home'); const lastElement = pathArray[pathArray.length - 1]; return decodeURIComponent(lastElement); }, [location.pathname]); return ( {t('appointments', 'Appointments')} ); } export const createDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () => ( );