From 21ca1befcd0ffb64fe6c4d09efbd2750154a8907 Mon Sep 17 00:00:00 2001 From: seriouselly Date: Sun, 14 Jun 2026 23:59:59 +0700 Subject: [PATCH] refactor(diagnosis/catalog): improve UI consistency and fix data rendering - Fix reference error in `DiagnosisResultView` by correctly mapping `riskLevel` prop. - Integrate dynamic `RiskBadge` with automated severity-to-color mapping for both diagnosis and catalog views. - Update icons in the medicine recommendation section of `catalog-page` and `DiagnosisResultView` for better visual consistency and intuition. --- .../src/components/diagnose-result-view.tsx | 29 ++++--------------- apps/web/src/pages/catalog-page.tsx | 3 +- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/apps/web/src/components/diagnose-result-view.tsx b/apps/web/src/components/diagnose-result-view.tsx index cd1fbe3..88cc2f1 100644 --- a/apps/web/src/components/diagnose-result-view.tsx +++ b/apps/web/src/components/diagnose-result-view.tsx @@ -8,8 +8,9 @@ import { Pill, RefreshCcw, FlaskConical, + CheckCircle2, } from "lucide-react"; -import { RiskBadge } from "./risk-badge"; +import { RiskBadge } from "@/components/risk-badge"; type Props = { imageUrl: string; @@ -103,7 +104,7 @@ export function DiagnosisResultView({ Tingkat Keparahan: - + @@ -193,7 +194,7 @@ export function DiagnosisResultView({ >
- +
Rekomendasi Obat
@@ -208,7 +209,7 @@ export function DiagnosisResultView({
    {medicines.map((med, i) => (
  • - {" "} + {" "} {med}
  • ))} @@ -237,23 +238,3 @@ export function DiagnosisResultView({ ); } - -function CheckCircle2(props: any) { - return ( - - - - - ); -} diff --git a/apps/web/src/pages/catalog-page.tsx b/apps/web/src/pages/catalog-page.tsx index 775a638..e77106b 100644 --- a/apps/web/src/pages/catalog-page.tsx +++ b/apps/web/src/pages/catalog-page.tsx @@ -8,7 +8,6 @@ import { Pill, ShieldCheck, Search, - Leaf, FlaskConical, } from "lucide-react"; import { apiClient } from "@/lib/api-client"; @@ -105,7 +104,7 @@ export function CatalogPage() {

    Tidak ada penyakit yang sesuai dengan pencarianmu. -

    +

    F
    ) : ( filteredDiseases.map((disease) => {