+ {/* Create Flow */}
+ {!resourceId && (
+ <>
+
+
+
+
+ {t("approving_facility")}
+ {
+ field("approving_facility_object").onChange({
+ name: "approving_facility_object",
+ value: selected,
+ });
+ }}
+ {...field(
+ "approving_facility_object",
+ RequiredFieldValidator(t("approving_facility_error")),
+ )}
+ errors={state.errors.approving_facility_object}
+ />
+
+
(o ? t("yes") : t("no"))}
+ optionValue={(o) => String(o)}
+ {...field("emergency")}
+ />
+
+ option}
+ optionValue={(option: string) => option}
+ required
+ />
+ option.text}
+ optionValue={(option: OptionsType) => option.id}
+ />
+
+
+
+
+
+
+ >
+ )}
+
+ {/* Update Flow */}
+ {resourceId && (
+ <>
+ option}
+ {...field("status")}
+ />
+ {assignedUserLoading ? (
+
+ ) : (
+
+ )}
+
+
+ {t("approving_facility")}
+ {
+ field("approving_facility_object").onChange({
+ name: "approving_facility_object",
+ value: selected,
+ });
+ }}
+ {...field(
+ "approving_facility_object",
+ RequiredFieldValidator(t("approving_facility_error")),
+ )}
+ errors={state.errors.approving_facility_object}
+ />
+
+
+ {t("assign_facility_label")}
+ {
+ field("assigned_facility_object").onChange({
+ name: "assigned_facility_object",
+ value: selected,
+ });
+ }}
+ errors={state.errors.assigned_facility_object}
+ />
+
+
+
+
+ (o ? t("yes") : t("no"))}
+ optionValue={(o) => String(o)}
+ {...field("emergency")}
+ />
+
+
+
+ >
+ )}
+
+ )}
+