@openmrs/esm-billing-app 1.0.2-pre.866 → 1.0.2-pre.873

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +0,0 @@
1
- import React, { useMemo } from 'react';
2
- import { InlineLoading } from '@carbon/react';
3
- import { useTranslation } from 'react-i18next';
4
- import { ErrorState } from '@openmrs/esm-patient-common-lib';
5
- import { getCoreTranslation } from '@openmrs/esm-framework';
6
- import { useBillableServices } from '../billable-service.resource';
7
- import Card from '../../metrics-cards/card.component';
8
- import styles from '../../metrics-cards/metrics-cards.scss';
9
-
10
- export default function ServiceMetrics() {
11
- const { t } = useTranslation();
12
- const { isLoading, error } = useBillableServices();
13
-
14
- const cards = useMemo(
15
- () => [
16
- { title: 'Cash Revenue', count: '--' },
17
- { title: 'Insurance Revenue', count: '--' },
18
- { title: 'Pending Claims', count: '--' },
19
- ],
20
- [],
21
- );
22
-
23
- if (isLoading) {
24
- return (
25
- <section className={styles.container}>
26
- <InlineLoading
27
- status="active"
28
- iconDescription={getCoreTranslation('loading')}
29
- description={t('loadingServiceMetrics', 'Loading service metrics') + '...'}
30
- />
31
- </section>
32
- );
33
- }
34
-
35
- if (error) {
36
- return (
37
- <div className={styles.errorContainer}>
38
- <ErrorState headerTitle={t('serviceMetrics', 'Service Metrics')} error={error} />
39
- </div>
40
- );
41
- }
42
- return (
43
- <section className={styles.container}>
44
- {cards.map((card) => (
45
- <Card key={card.title} title={card.title} count={card.count} />
46
- ))}
47
- </section>
48
- );
49
- }