@bahmni/home-app 0.0.1-dev.423 → 0.0.1-dev.425

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,111 +0,0 @@
1
- import { jsxs as c, jsx as e, Fragment as b } from "react/jsx-runtime";
2
- import { u as m, W as p, D as y, G as H, H as N, e as E, I as P, K as v, M as G, Q as f, U as L, X as O, Z as S } from "./index-0gCl6Ezv.js";
3
- import "react";
4
- import { useQuery as T } from "@tanstack/react-query";
5
- const C = "AppTile-module_tile__-CBFh", B = "AppTile-module_label__6vslD", M = "AppTile-module_bottom__lcJiG", d = {
6
- tile: C,
7
- label: B,
8
- bottom: M
9
- }, A = ({ id: o, label: n, icon: s, url: l }) => {
10
- const { t } = m(), i = t(n);
11
- return /* @__PURE__ */ c(
12
- p,
13
- {
14
- href: l,
15
- className: d.tile,
16
- "aria-label": i,
17
- testId: `app-tile-${o}`,
18
- children: [
19
- /* @__PURE__ */ e("h2", { className: d.label, "aria-hidden": "true", children: i }),
20
- /* @__PURE__ */ c("div", { className: d.bottom, children: [
21
- /* @__PURE__ */ e(y, { name: s, id: o, size: H.X2, "aria-hidden": "true" }),
22
- /* @__PURE__ */ e(N, { size: 20, "aria-hidden": "true" })
23
- ] })
24
- ]
25
- }
26
- );
27
- }, K = "HomePageGrid-module_container__Kxfim", k = "HomePageGrid-module_tileGrid__X6-Bm", x = "HomePageGrid-module_skeletonTile__U-1vu", F = "HomePageGrid-module_emptyState__xEwoK", I = "HomePageGrid-module_errorContainer__IKR3E", r = {
28
- container: K,
29
- tileGrid: k,
30
- skeletonTile: x,
31
- emptyState: F,
32
- errorContainer: I
33
- }, D = () => {
34
- const { t: o } = m(), {
35
- userPrivileges: n,
36
- isLoading: s,
37
- error: l
38
- } = E(), t = n?.map((a) => a.name) ?? null, {
39
- data: i = [],
40
- isLoading: _,
41
- isError: u,
42
- refetch: h
43
- } = T({
44
- queryKey: ["home-modules", t],
45
- queryFn: () => P("org.bahmni.home.dashboard", t),
46
- enabled: !s && l === null && t !== null
47
- });
48
- return s || _ || t === null && !l ? /* @__PURE__ */ e(
49
- "div",
50
- {
51
- className: r.container,
52
- role: "status",
53
- "aria-label": o("HOME_LOADING_MODULES"),
54
- "aria-busy": "true",
55
- children: /* @__PURE__ */ e("div", { className: r.tileGrid, children: Array.from(
56
- { length: v },
57
- (a, g) => `skeleton-${g}`
58
- ).map((a) => /* @__PURE__ */ e(G, { className: r.skeletonTile }, a)) })
59
- }
60
- ) : l || u ? /* @__PURE__ */ e(
61
- "div",
62
- {
63
- className: r.errorContainer,
64
- "data-testid": "home-error",
65
- role: "alert",
66
- children: /* @__PURE__ */ e(
67
- f,
68
- {
69
- kind: "error",
70
- lowContrast: !0,
71
- subtitle: o("HOME_ERROR_FETCH_CONFIG"),
72
- hideCloseButton: !1,
73
- onClose: () => void h()
74
- }
75
- )
76
- }
77
- ) : i.length === 0 ? /* @__PURE__ */ e("div", { className: r.emptyState, role: "status", children: o("HOME_NO_MODULES") }) : /* @__PURE__ */ e("div", { className: r.container, children: /* @__PURE__ */ e("div", { className: r.tileGrid, children: i.map((a) => /* @__PURE__ */ e(
78
- A,
79
- {
80
- id: a.id,
81
- label: a.translationKey ?? a.label,
82
- icon: a.icon,
83
- url: a.url
84
- },
85
- a.id
86
- )) }) });
87
- }, R = "HomePageHeader-module_locationSelector__foYmn", U = {
88
- locationSelector: R
89
- }, $ = () => {
90
- const { t: o } = m();
91
- return /* @__PURE__ */ e(
92
- L,
93
- {
94
- ariaLabel: "Bahmni",
95
- brandPrefix: o("HOME_LABEL"),
96
- brandHref: "/",
97
- globalFeatures: [
98
- /* @__PURE__ */ e("div", { className: U.locationSelector, children: /* @__PURE__ */ e(S, {}) }, "location")
99
- ],
100
- userMenu: /* @__PURE__ */ e(O, {})
101
- }
102
- );
103
- }, q = "HomePage-module_homePageBody__0qtrS", j = {
104
- homePageBody: q
105
- }, W = () => /* @__PURE__ */ c(b, { children: [
106
- /* @__PURE__ */ e($, {}),
107
- /* @__PURE__ */ e("main", { className: j.homePageBody, children: /* @__PURE__ */ e(D, {}) })
108
- ] });
109
- export {
110
- W as HomePage
111
- };