-
- ({ label: c, value: c }))}
- value={form.nationality || ""}
- onChange={(value) => {
- setForm((f) => ({
- ...f,
- nationality: value,
- }));
- }}
- />
-
+
+
({ label: c, value: c }))}
+ value={form.nationality || ""}
+ onChange={(value) => {
+ setForm((f) => ({
+ ...f,
+ nationality: value,
+ }));
+ }}
+ />
+
+ {errors["nationality"] &&
+ errors["nationality"]?.map((error, i) => (
+
+ {error}
+
+ ))}
+
{form.nationality === "India" && (
<>
diff --git a/src/components/ui/errors.tsx b/src/components/ui/errors.tsx
deleted file mode 100644
index debe66d7308..00000000000
--- a/src/components/ui/errors.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-export function InputErrors({ errors }: { errors?: string[] }) {
- return errors && !!errors.length ? (
-
- {errors?.map((error, i) => (
-
- {error}
-
- ))}
-
- ) : null;
-}
diff --git a/src/components/ui/input-with-error.tsx b/src/components/ui/input-with-error.tsx
deleted file mode 100644
index 01e27d92775..00000000000
--- a/src/components/ui/input-with-error.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { InputErrors } from "./errors";
-import { Label } from "./label";
-
-export default function InputWithError(props: {
- label?: string;
- required?: boolean;
- errors?: string[];
- children: React.ReactNode;
-}) {
- const { label, errors, children, required } = props;
-
- return (
- <>
- {label && (
-
- )}
- {children}
-
- >
- );
-}
diff --git a/src/pages/FacilityOrganization/components/FacilityOrganizationSelector.tsx b/src/pages/FacilityOrganization/components/FacilityOrganizationSelector.tsx
index 92b0778d184..b9c32974a82 100644
--- a/src/pages/FacilityOrganization/components/FacilityOrganizationSelector.tsx
+++ b/src/pages/FacilityOrganization/components/FacilityOrganizationSelector.tsx
@@ -1,12 +1,13 @@
import { useQuery } from "@tanstack/react-query";
import { useState } from "react";
+import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";
import Autocomplete from "@/components/ui/autocomplete";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
-import InputWithError from "@/components/ui/input-with-error";
+import { Label } from "@/components/ui/label";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
@@ -31,6 +32,7 @@ interface AutoCompleteOption {
export default function FacilityOrganizationSelector(
props: FacilityOrganizationSelectorProps,
) {
+ const { t } = useTranslation();
const { onChange, required, facilityId } = props;
const [selectedLevels, setSelectedLevels] = useState
(
[],
@@ -106,7 +108,11 @@ export default function FacilityOrganizationSelector(
};
return (
-
+ <>
+
{/* Selected Organization Display */}
{selectedOrganization && (
@@ -185,6 +191,6 @@ export default function FacilityOrganizationSelector(
)}
-
+ >
);
}
diff --git a/src/pages/Organization/components/OrganizationSelector.tsx b/src/pages/Organization/components/OrganizationSelector.tsx
index a5880f30872..4f4be545bb2 100644
--- a/src/pages/Organization/components/OrganizationSelector.tsx
+++ b/src/pages/Organization/components/OrganizationSelector.tsx
@@ -6,7 +6,7 @@ import CareIcon from "@/CAREUI/icons/CareIcon";
import Autocomplete from "@/components/ui/autocomplete";
import { Button } from "@/components/ui/button";
-import InputWithError from "@/components/ui/input-with-error";
+import { Label } from "@/components/ui/label";
import useDebouncedState from "@/hooks/useDebouncedState";
@@ -111,27 +111,25 @@ export default function OrganizationSelector(props: OrganizationSelectorProps) {
{/* Selected Levels */}
{selectedLevels.map((level, index) => (