@cccsaurora/howler-ui 2.17.0-dev.523 → 2.17.0-dev.525
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.
|
@@ -19,8 +19,11 @@ const AGGREGATE_FIELDS = [
|
|
|
19
19
|
];
|
|
20
20
|
const getDuration = (case_) => {
|
|
21
21
|
if (case_?.start) {
|
|
22
|
-
return dayjs
|
|
22
|
+
return dayjs
|
|
23
|
+
.duration(dayjs(case_?.end ?? new Date()).diff(dayjs(case_.start), 'minute'), 'minute')
|
|
24
|
+
.format('HH[h] mm[m]');
|
|
23
25
|
}
|
|
26
|
+
return '--';
|
|
24
27
|
};
|
|
25
28
|
const CaseDashboard = ({ case: providedCase, caseId }) => {
|
|
26
29
|
const { t } = useTranslation();
|
|
@@ -41,6 +44,6 @@ const CaseDashboard = ({ case: providedCase, caseId }) => {
|
|
|
41
44
|
if (!_case) {
|
|
42
45
|
return null;
|
|
43
46
|
}
|
|
44
|
-
return (_jsxs(Grid, { container: true, spacing: 5, width: "100%", px: 3, children: [_jsx(Grid, { item: true, xs: 12, children: _jsx(CaseOverview, { case: _case, updateCase: updateCase }) }), AGGREGATE_FIELDS.map(([field, icon, iconColor, subtitle]) => (_jsx(Grid, { item: true, xs: 12, md: 6, xl: 3, children: _jsx(CaseAggregate, { icon: icon, iconColor: iconColor && get(theme.palette, iconColor), field: field, records: records, subtitle: t(subtitle) }) }, field))), _jsx(Grid, { item: true, xs: 12, md: 6, xl: 3, children: _jsx(CaseAggregate, { icon: "mingcute:heartbeat-line", iconColor: theme.palette.error.light, title: getDuration(_case)
|
|
47
|
+
return (_jsxs(Grid, { container: true, spacing: 5, width: "100%", px: 3, children: [_jsx(Grid, { item: true, xs: 12, children: _jsx(CaseOverview, { case: _case, updateCase: updateCase }) }), AGGREGATE_FIELDS.map(([field, icon, iconColor, subtitle]) => (_jsx(Grid, { item: true, xs: 12, md: 6, xl: 3, children: _jsx(CaseAggregate, { icon: icon, iconColor: iconColor && get(theme.palette, iconColor), field: field, records: records, subtitle: t(subtitle) }) }, field))), _jsx(Grid, { item: true, xs: 12, md: 6, xl: 3, children: _jsx(CaseAggregate, { icon: "mingcute:heartbeat-line", iconColor: theme.palette.error.light, title: getDuration(_case), subtitle: t('page.cases.dashboard.duration') }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(TaskPanel, { case: _case, updateCase: updateCase }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(AlertPanel, { case: _case }) }), _jsx(Grid, { item: true, xs: 12, children: _jsx(RelatedCasePanel, { case: _case }) })] }));
|
|
45
48
|
};
|
|
46
49
|
export default CaseDashboard;
|