Skip to content

Commit

Permalink
Remove Add Location
Browse files Browse the repository at this point in the history
  • Loading branch information
amjithtitus09 committed Feb 27, 2025
1 parent 2c7121b commit 179a98b
Showing 1 changed file with 37 additions and 42 deletions.
79 changes: 37 additions & 42 deletions src/components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,36 +325,28 @@ export default function PatientInfoCard(props: PatientInfoCardProps) {
)
}

{!disableButtons ? (
<LinkDepartmentsSheet
entityType="encounter"
entityId={encounter.id}
currentOrganizations={encounter.organizations}
facilityId={encounter.facility.id}
trigger={
<div className="flex flex-wrap gap-2">
{encounter.organizations.map((org) =>
organizationBadge(org),
)}
{encounter.organizations.length === 0 && (
<Badge
className="capitalize gap-1 py-1 px-2 cursor-pointer hover:bg-secondary-100"
variant="outline"
>
<Building className="w-4 h-4 text-blue-400" />
Add Organizations
</Badge>
)}
</div>
}
/>
) : (
<div className="flex flex-wrap gap-2">
{encounter.organizations.map((org) =>
organizationBadge(org),
)}
</div>
)}
<LinkDepartmentsSheet
entityType="encounter"
entityId={encounter.id}
currentOrganizations={encounter.organizations}
facilityId={encounter.facility.id}
trigger={
<div className="flex flex-wrap gap-2">
{encounter.organizations.map((org) =>
organizationBadge(org),
)}
{encounter.organizations.length === 0 && (
<Badge
className="capitalize gap-1 py-1 px-2 cursor-pointer hover:bg-secondary-100"
variant="outline"
>
<Building className="w-4 h-4 text-blue-400" />
Add Organizations
</Badge>
)}
</div>
}
/>
{props.encounter.current_location ? (
<Popover>
<PopoverTrigger asChild>
Expand Down Expand Up @@ -422,18 +414,21 @@ export default function PatientInfoCard(props: PatientInfoCardProps) {
</PopoverContent>
</Popover>
) : (
<Badge variant="outline">
<Link
href={`/facility/${props.encounter.facility.id}/patient/${props.patient.id}/encounter/${props.encounter.id}/questionnaire/location_association`}
className="flex items-center gap-1 text-gray-950 py-0.5"
>
<CareIcon
icon="l-location-point"
className="h-4 w-4 text-green-600"
/>
{t("add_location")}
</Link>
</Badge>
encounter.status !== "completed" &&
!disableButtons && (
<Badge variant="outline">
<Link
href={`/facility/${props.encounter.facility.id}/patient/${props.patient.id}/encounter/${props.encounter.id}/questionnaire/location_association`}
className="flex items-center gap-1 text-gray-950 py-0.5"
>
<CareIcon
icon="l-location-point"
className="h-4 w-4 text-green-600"
/>
{t("add_location")}
</Link>
</Badge>
)
)}
</div>
</div>
Expand Down

0 comments on commit 179a98b

Please sign in to comment.