Skip to content

Commit

Permalink
move encounterClass icon to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Feb 20, 2025
1 parent 573acf2 commit 58cfb52
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
20 changes: 20 additions & 0 deletions src/common/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import {
Ambulance,
BedDouble,
Building2,
Home,
LucideIcon,
MonitorSmartphone,
Stethoscope,
} from "lucide-react";

import { IconName } from "@/CAREUI/icons/CareIcon";

import { EncounterClass } from "@/types/emr/encounter";

export const RESULTS_PER_PAGE_LIMIT = 14;

/**
Expand Down Expand Up @@ -354,6 +366,14 @@ export const FILE_EXTENSIONS = {
PRESENTATION: ["pptx"],
DOCUMENT: ["pdf", "docx"],
} as const;
export const encounterIcons = {
imp: BedDouble,
amb: Ambulance,
obsenc: Stethoscope,
emer: Building2,
vr: MonitorSmartphone,
hh: Home,
} as const satisfies Record<EncounterClass, LucideIcon>;

export const PREVIEWABLE_FILE_EXTENSIONS = [
"html",
Expand Down
24 changes: 3 additions & 21 deletions src/components/Facility/EncounterCard.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import { t } from "i18next";
import {
Ambulance,
BadgeCheck,
BedDouble,
Building2,
CircleDashed,
Clock,
Eye,
Home,
MonitorSmartphone,
Stethoscope,
} from "lucide-react";
import { BadgeCheck, CircleDashed, Clock, Eye } from "lucide-react";
import { Link } from "raviger";

import { cn } from "@/lib/utils";
Expand All @@ -20,6 +9,8 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";

import { encounterIcons } from "@/common/constants";

import { formatDateTime } from "@/Utils/utils";
import { Encounter, completedEncounterStatus } from "@/types/emr/encounter";

Expand All @@ -30,15 +21,6 @@ interface EncounterCardProps {
export const EncounterCard = (props: EncounterCardProps) => {
const { encounter } = props;

const encounterIcons = {
imp: BedDouble,
amb: Ambulance,
obsenc: Stethoscope,
emer: Building2,
vr: MonitorSmartphone,
hh: Home,
} as const;

const Icon = encounterIcons[encounter.encounter_class];

return (
Expand Down

0 comments on commit 58cfb52

Please sign in to comment.