refactor(diagnosis): enhance detail page usability and data robustness
- Implement `useEffect` to ensure smooth scroll-to-top on navigation. - Add fallback logic to populate medicine recommendations from local seed data if backend payload is incomplete. - Integrate dynamic `RiskBadge` component with automated severity-to-color mapping for better visual clarity.
This commit is contained in:
@@ -45,7 +45,7 @@ export function DiagnosisDetailPage() {
|
||||
|
||||
const diagnosis = query.data;
|
||||
|
||||
// fallback Logic for image and medicine recommendations
|
||||
// Fallback logic for image and medicine recommendations
|
||||
const finalImageUrl =
|
||||
diagnosis.imageUrl || "/src/assets/images/placeholder-image.png";
|
||||
|
||||
@@ -64,7 +64,7 @@ export function DiagnosisDetailPage() {
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-xl md:text-3xl font-extrabold text-[#214B11]">
|
||||
<h1 className="text-xl md:text-2xl font-bold text-[#214B11]">
|
||||
Analisis & Modul Edukasi
|
||||
</h1>
|
||||
<p className="text-sm font-medium text-slate-500 mt-1">
|
||||
|
||||
Reference in New Issue
Block a user