Skip to content

Commit

Permalink
add loading..
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Jan 22, 2025
1 parent 5a3feb0 commit f9c9ae2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
10 changes: 6 additions & 4 deletions src/components/Facility/FacilityUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ export default function FacilityUsers(props: { facilityId: string }) {
className="bg-purple-50 text-purple-700 ml-2 text-sm font-medium rounded-xl px-3 m-3"
variant="outline"
>
{t("entity_count", {
count: userListData?.count || "...",
entity: "User",
})}
{userListData
? t("entity_count", {
count: userListData?.count || 0,
entity: "User",
})
: "Loading..."}
</Badge>
}
>
Expand Down
8 changes: 5 additions & 3 deletions src/pages/Organization/OrganizationFacilities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ export default function OrganizationFacilities({
className="bg-purple-50 text-purple-700 ml-2 text-sm font-medium rounded-xl px-3 m-3"
variant="outline"
>
{t("facility_count", {
count: facilities?.count || "...",
})}
{facilities
? t("facility_count", {
count: facilities.count,
})
: "Loading..."}
</Badge>
</div>
<AddFacilitySheet organizationId={id} />
Expand Down
10 changes: 6 additions & 4 deletions src/pages/Organization/OrganizationPatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ export default function OrganizationPatients({ id, navOrganizationId }: Props) {
className="bg-purple-50 text-purple-700 ml-2 text-sm font-medium rounded-xl px-3 m-3"
variant="outline"
>
{t("entity_count", {
count: patients?.count || "...",
entity: "Patient",
})}
{patients
? t("entity_count", {
count: patients.count,
entity: "Patient",
})
: "Loading..."}
</Badge>
</div>
</div>
Expand Down
10 changes: 6 additions & 4 deletions src/pages/Organization/OrganizationUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ export default function OrganizationUsers({ id, navOrganizationId }: Props) {
className="bg-purple-50 text-purple-700 ml-2 text-sm font-medium rounded-xl px-3 m-3"
variant="outline"
>
{t("entity_count", {
count: users?.count || "...",
entity: "User",
})}
{users
? t("entity_count", {
count: users.count || 0,
entity: "User",
})
: "Loading..."}
</Badge>
</div>
<div className="flex gap-2">
Expand Down
10 changes: 6 additions & 4 deletions src/pages/Organization/OrganizationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ export default function OrganizationView({ id, navOrganizationId }: Props) {
className="bg-purple-50 text-purple-700 ml-2 text-sm font-medium rounded-xl px-3 m-3"
variant="outline"
>
{t("entity_count", {
count: children?.count || "...",
entity: "Organization",
})}
{children
? t("entity_count", {
count: children.count || 0,
entity: "Organization",
})
: "Loading..."}
</Badge>
</div>
<div className="w-72">
Expand Down

0 comments on commit f9c9ae2

Please sign in to comment.