From cecd591f4741da38e6b19d79604b1fd8769ff4aa Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Mon, 11 Aug 2025 16:02:36 +0700 Subject: [PATCH 1/4] impl summary card patient --- app/components/flow/patient/list.vue | 89 ++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/app/components/flow/patient/list.vue b/app/components/flow/patient/list.vue index 0cae3161..676c893c 100644 --- a/app/components/flow/patient/list.vue +++ b/app/components/flow/patient/list.vue @@ -1,5 +1,9 @@ From 7f7dfe0a024e07f8a205699c9866b147cdf4d9f3 Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Tue, 12 Aug 2025 14:38:20 +0700 Subject: [PATCH 2/4] =?UTF-8?q?feat(pub/base):=20add=20reusable=20Summary?= =?UTF-8?q?=20Card=20+=20Summary=20type=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `summary-card.vue` with skeleton state โณ - Add `summary-card.type.ts` with `Summary` interface and timeframe mapping ๐Ÿ“… --- app/components/pub/base/summary-card.type.ts | 7 ++ app/components/pub/base/summary-card.vue | 71 ++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 app/components/pub/base/summary-card.type.ts create mode 100644 app/components/pub/base/summary-card.vue diff --git a/app/components/pub/base/summary-card.type.ts b/app/components/pub/base/summary-card.type.ts new file mode 100644 index 00000000..64304eaf --- /dev/null +++ b/app/components/pub/base/summary-card.type.ts @@ -0,0 +1,7 @@ +export interface Summary { + title: string + icon: Component + metric: number + trend: number + timeframe: 'yearly' | 'monthly' | 'weekly' | 'daily' +} diff --git a/app/components/pub/base/summary-card.vue b/app/components/pub/base/summary-card.vue new file mode 100644 index 00000000..411bb6fc --- /dev/null +++ b/app/components/pub/base/summary-card.vue @@ -0,0 +1,71 @@ + + + + + From cc2641548677e62a4555e8508f8dab0217fb554a Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Tue, 12 Aug 2025 14:38:40 +0700 Subject: [PATCH 3/4] =?UTF-8?q?refactor(flow/patient):=20use=20Summary=20C?= =?UTF-8?q?ard=20and=20loading=20state=20=E2=99=BB=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace inline cards with `PubBaseSummaryCard` - Add `isLoading.summary` and mock `getPatientSummary()` โณ - Render skeleton while loading; show data when ready โœ… - Update icons and remove `cn` ๐Ÿงน - Call `getPatientSummary()` and `getPatientList()` on mount ๐Ÿš€ --- app/components/flow/patient/list.vue | 136 ++++++++++++--------------- 1 file changed, 62 insertions(+), 74 deletions(-) diff --git a/app/components/flow/patient/list.vue b/app/components/flow/patient/list.vue index 676c893c..c3a39fce 100644 --- a/app/components/flow/patient/list.vue +++ b/app/components/flow/patient/list.vue @@ -1,7 +1,7 @@ From 949aa718b6a5dd3108ed53a188e88377d25f2f5e Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Tue, 12 Aug 2025 14:58:29 +0700 Subject: [PATCH 4/4] add condition if zero trends , hide the timeframe --- app/components/pub/base/summary-card.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/pub/base/summary-card.vue b/app/components/pub/base/summary-card.vue index 411bb6fc..d3413111 100644 --- a/app/components/pub/base/summary-card.vue +++ b/app/components/pub/base/summary-card.vue @@ -53,7 +53,7 @@ const isTrending = computed(() => (props.stat?.trend ?? 0) > 0)
{{ props.stat.metric.toLocaleString('id-ID') }}
-

+