From 96a00f67829c8c8da78b22aeaa1ce102aa6c73a4 Mon Sep 17 00:00:00 2001 From: yash-learner Date: Mon, 16 Dec 2024 01:36:01 +0530 Subject: [PATCH] Implement priority badge variant mapping --- .../LabTest/ListEncounterServiceRequests.tsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/LabTest/ListEncounterServiceRequests.tsx b/src/components/LabTest/ListEncounterServiceRequests.tsx index 23de18ab073..b17e2ee7b3d 100644 --- a/src/components/LabTest/ListEncounterServiceRequests.tsx +++ b/src/components/LabTest/ListEncounterServiceRequests.tsx @@ -1,7 +1,9 @@ +import { mapKeyToBadgeVariant } from "@/Utils/badgeUtils"; import routes from "@/Utils/request/api"; import useQuery from "@/Utils/request/useQuery"; import { Badge } from "../ui/badge"; +import { BadgeProps } from "../ui/badge"; import { Separator } from "../ui/separator"; import { Table, @@ -27,6 +29,13 @@ export default function ListEncounterServiceRequests({ // TODO: Add Loader while fetching data + const priorityVariantMap: Record = { + routine: "default", + asap: "warning", + urgent: "secondary", + stat: "destructive", + }; + return (
@@ -38,7 +47,7 @@ export default function ListEncounterServiceRequests({ Status - + {data?.results.map((request) => ( + - + {request.priority || "Routine"} + One-time + Pending