import { observer, useObserver } from 'mobx-react-lite'; import React, { useMemo } from 'react'; import SessionItem from 'Shared/SessionItem'; import { Pagination, NoContent } from 'UI'; import { useStore } from 'App/mstore'; import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import Session from 'App/mstore/types/session'; import { useTranslation } from 'react-i18next'; interface Props { metric: any; isTemplate?: boolean; isEdit?: boolean; data: any; } function CustomMetricTableSessions(props: Props) { const { t } = useTranslation(); const { isEdit = false, metric, data } = props; const sessions = useMemo( () => data && data.sessions ? data.sessions.map((session: any) => new Session().fromJson(session)) : [], [], ); return useObserver(() => (
{t('No relevant sessions found for the selected time period')}
} >
{sessions && sessions.map((session: any, index: any) => (
))} {isEdit && (
metric.updateKey('page', page)} limit={data.total} debounceRequest={500} />
)} {!isEdit && }
)); } export default observer(CustomMetricTableSessions); function ViewMore({ total, limit }: any) { const { t } = useTranslation(); return total > limit ? (
{t('All')} {total}  {t('sessions')}
) : null; }