diff --git a/package-lock.json b/package-lock.json index 323d9802cf9..59a22853fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "axios": "^1.7.7", "bowser": "^2.11.0", "browser-image-compression": "^2.0.2", + "browserslist": "^4.24.0", "browserslist-useragent-regexp": "^4.1.3", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", diff --git a/package.json b/package.json index 31ae858c588..68de432e82e 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "axios": "^1.7.7", "bowser": "^2.11.0", "browser-image-compression": "^2.0.2", + "browserslist": "^4.24.0", "browserslist-useragent-regexp": "^4.1.3", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", diff --git a/src/Components/ABDM/ConfigureHealthFacility.tsx b/src/Components/ABDM/ConfigureHealthFacility.tsx index 8259cd18a33..f78a65f2cd1 100644 --- a/src/Components/ABDM/ConfigureHealthFacility.tsx +++ b/src/Components/ABDM/ConfigureHealthFacility.tsx @@ -1,4 +1,4 @@ -import { lazy, useReducer, useState } from "react"; +import { useReducer, useState } from "react"; import * as Notification from "../../Utils/Notifications.js"; import { navigate } from "raviger"; import { Submit } from "../Common/components/ButtonV2"; @@ -8,8 +8,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; import { FieldChangeEvent } from "../Form/FormFields/Utils.js"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const initForm = { health_facility: null, hf_id: "", diff --git a/src/Components/Assets/AssetImportModal.tsx b/src/Components/Assets/AssetImportModal.tsx index 6ff51e293af..9be1c393960 100644 --- a/src/Components/Assets/AssetImportModal.tsx +++ b/src/Components/Assets/AssetImportModal.tsx @@ -1,4 +1,4 @@ -import { useState, lazy } from "react"; +import { lazy, useState } from "react"; import { sleep } from "../../Utils/utils"; import { FacilityModel } from "../Facility/models"; import { AssetData } from "./AssetTypes"; diff --git a/src/Components/Assets/AssetManage.tsx b/src/Components/Assets/AssetManage.tsx index 4c17721e1f9..69c8bc92f97 100644 --- a/src/Components/Assets/AssetManage.tsx +++ b/src/Components/Assets/AssetManage.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactElement, lazy } from "react"; +import { useState, useEffect, ReactElement } from "react"; import { AssetClass, assetClassProps, @@ -18,7 +18,7 @@ import { UserRole, USER_TYPES } from "../../Common/constants"; import ConfirmDialog from "../Common/ConfirmDialog"; import RecordMeta from "../../CAREUI/display/RecordMeta"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); +import Loading from "@/Components/Common/Loading"; import * as Notification from "../../Utils/Notifications.js"; import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import Uptime from "../Common/Uptime"; diff --git a/src/Components/Assets/AssetsList.tsx b/src/Components/Assets/AssetsList.tsx index 5e29bbc0dfd..ee27c2a484f 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -1,7 +1,7 @@ import { IDetectedBarcode, Scanner } from "@yudiel/react-qr-scanner"; import * as Notification from "../../Utils/Notifications.js"; import { assetClassProps, AssetData } from "./AssetTypes"; -import { useState, useEffect, lazy } from "react"; +import { useState, useEffect } from "react"; import { Link, navigate } from "raviger"; import AssetFilter from "./AssetFilter"; import { parseQueryParams } from "../../Utils/primitives"; @@ -24,8 +24,7 @@ import request from "../../Utils/request/request"; import routes from "../../Redux/api"; import useQuery from "../../Utils/request/useQuery"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const AssetsList = () => { const { t } = useTranslation(); const { diff --git a/src/Components/Facility/AddBedForm.tsx b/src/Components/Facility/AddBedForm.tsx index 047549bd652..3bb43f9a27e 100644 --- a/src/Components/Facility/AddBedForm.tsx +++ b/src/Components/Facility/AddBedForm.tsx @@ -1,6 +1,6 @@ import Card from "../../CAREUI/display/Card"; -import { useState, lazy, SyntheticEvent } from "react"; +import { useState, SyntheticEvent } from "react"; import * as Notification from "../../Utils/Notifications.js"; import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; import { SelectFormField } from "../Form/FormFields/SelectFormField"; @@ -15,8 +15,7 @@ import useAppHistory from "../../Common/hooks/useAppHistory"; import request from "../../Utils/request/request"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface Props { facilityId: string; locationId: string; diff --git a/src/Components/Facility/AddInventoryForm.tsx b/src/Components/Facility/AddInventoryForm.tsx index 673e9949025..08fd7479dc8 100644 --- a/src/Components/Facility/AddInventoryForm.tsx +++ b/src/Components/Facility/AddInventoryForm.tsx @@ -1,4 +1,4 @@ -import { useReducer, useState, useEffect, lazy } from "react"; +import { useReducer, useState, useEffect } from "react"; import Card from "../../CAREUI/display/Card"; import * as Notification from "../../Utils/Notifications.js"; import Page from "../Common/components/Page"; @@ -11,8 +11,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const initForm = { id: "", quantity: "", diff --git a/src/Components/Facility/AddLocationForm.tsx b/src/Components/Facility/AddLocationForm.tsx index cdb7506cbec..5b480d89d89 100644 --- a/src/Components/Facility/AddLocationForm.tsx +++ b/src/Components/Facility/AddLocationForm.tsx @@ -1,4 +1,4 @@ -import { useState, lazy, SyntheticEvent } from "react"; +import { useState, SyntheticEvent } from "react"; import * as Notification from "../../Utils/Notifications.js"; import { navigate } from "raviger"; import { Submit, Cancel } from "../Common/components/ButtonV2"; @@ -11,8 +11,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface Props { facilityId: string; locationId?: string; diff --git a/src/Components/Facility/AssetCreate.tsx b/src/Components/Facility/AssetCreate.tsx index efa222308b3..110bf525509 100644 --- a/src/Components/Facility/AssetCreate.tsx +++ b/src/Components/Facility/AssetCreate.tsx @@ -7,7 +7,6 @@ import { MutableRefObject, RefObject, createRef, - lazy, useEffect, useReducer, useState, @@ -37,8 +36,7 @@ import routes from "../../Redux/api.js"; import request from "../../Utils/request/request.js"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const formErrorKeys = [ "name", "asset_class", diff --git a/src/Components/Facility/BedManagement.tsx b/src/Components/Facility/BedManagement.tsx index b46323b74bb..5816ff58d4b 100644 --- a/src/Components/Facility/BedManagement.tsx +++ b/src/Components/Facility/BedManagement.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import { BedModel } from "./models"; import { ReactElement } from "react"; @@ -13,8 +13,7 @@ import routes from "../../Redux/api"; import useQuery from "../../Utils/request/useQuery"; import useFilters from "../../Common/hooks/useFilters"; import useAuthUser from "../../Common/hooks/useAuthUser"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface BedManagementProps { facilityId: string; locationId: string; diff --git a/src/Components/Facility/ConsultationClaims.tsx b/src/Components/Facility/ConsultationClaims.tsx index 41535ce1853..853d44c3c4c 100644 --- a/src/Components/Facility/ConsultationClaims.tsx +++ b/src/Components/Facility/ConsultationClaims.tsx @@ -2,7 +2,7 @@ import * as Notification from "../../Utils/Notifications"; import ClaimCard from "../HCX/ClaimCard"; import CreateClaimCard from "../HCX/CreateClaimCard"; -import PageTitle from "../Common/PageTitle"; +import PageTitle from "@/Components/Common/PageTitle"; import { navigate } from "raviger"; import routes from "../../Redux/api"; import { useMessageListener } from "../../Common/hooks/useMessageListener"; diff --git a/src/Components/Facility/ConsultationDetails/ConsultationABGTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationABGTab.tsx index ea0e466dffa..48cdc363f9b 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationABGTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationABGTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { ABGPlots } from "../Consultations/ABGPlots"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationABGTab = (props: ConsultationTabProps) => { return ( diff --git a/src/Components/Facility/ConsultationDetails/ConsultationDialysisTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationDialysisTab.tsx index 43aaf627534..8bd5201d922 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationDialysisTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationDialysisTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { DialysisPlots } from "../Consultations/DialysisPlots"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationDialysisTab = (props: ConsultationTabProps) => { return ( diff --git a/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx index 99e25067c34..7f49fda1581 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx @@ -1,4 +1,3 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { NonReadOnlyUsers } from "../../../Utils/AuthorizeFor"; import ButtonV2 from "../../Common/components/ButtonV2"; @@ -7,7 +6,7 @@ import CareIcon from "../../../CAREUI/icons/CareIcon"; import InvestigationTab from "../Investigations/investigationsTab"; import { t } from "i18next"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationInvestigationsTab = (props: ConsultationTabProps) => { return (
diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNeurologicalMonitoringTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNeurologicalMonitoringTab.tsx index d6e0b611003..7aed6bb96d5 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNeurologicalMonitoringTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNeurologicalMonitoringTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { NeurologicalTable } from "../Consultations/NeurologicalTables"; import { ConsultationTabProps } from "./index"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationNeurologicalMonitoringTab = ( props: ConsultationTabProps, diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index 2f689c82d19..63e3330bffd 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -1,4 +1,4 @@ -import { lazy, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { ConsultationTabProps } from "./index"; import { NursingPlot } from "../Consultations/NursingPlot"; import { useTranslation } from "react-i18next"; @@ -10,7 +10,7 @@ import { classNames, formatDate, formatTime } from "../../../Utils/utils"; import Pagination from "../../Common/Pagination"; import { PAGINATION_LIMIT } from "../../../Common/constants"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export default function ConsultationNursingTab(props: ConsultationTabProps) { const { t } = useTranslation(); diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNutritionTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNutritionTab.tsx index 75e0987cffd..f1b51ec4b81 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNutritionTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNutritionTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { NutritionPlots } from "../Consultations/NutritionPlots"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationNutritionTab = (props: ConsultationTabProps) => { return ( diff --git a/src/Components/Facility/ConsultationDetails/ConsultationPressureSoreTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationPressureSoreTab.tsx index 05327ca6870..5f8c0403afe 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationPressureSoreTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationPressureSoreTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { PressureSoreDiagrams } from "../Consultations/PressureSoreDiagrams"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationPressureSoreTab = (props: ConsultationTabProps) => { return ( diff --git a/src/Components/Facility/ConsultationDetails/ConsultationSummaryTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationSummaryTab.tsx index 09f6cb05a7b..ef4482b674c 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationSummaryTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationSummaryTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { PrimaryParametersPlot } from "../Consultations/PrimaryParametersPlot"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationSummaryTab = (props: ConsultationTabProps) => { return ( diff --git a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx index a1f898ee9c5..88b9b292eea 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import { ConsultationTabProps } from "./index"; import { AssetBedModel, AssetClass, AssetData } from "../../Assets/AssetTypes"; import { BedModel } from "../models"; @@ -25,7 +25,7 @@ import CareIcon from "../../../CAREUI/icons/CareIcon"; import EncounterSymptomsCard from "../../Symptoms/SymptomsCard"; import Tabs from "../../Common/components/Tabs"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationUpdatesTab = (props: ConsultationTabProps) => { const [hl7SocketUrl, setHL7SocketUrl] = useState(); diff --git a/src/Components/Facility/ConsultationDetails/ConsultationVentilatorTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationVentilatorTab.tsx index 36a72ab789e..3381045faeb 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationVentilatorTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationVentilatorTab.tsx @@ -1,8 +1,7 @@ -import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { VentilatorPlot } from "../Consultations/VentilatorPlot"; -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import PageTitle from "@/Components/Common/PageTitle"; export const ConsultationVentilatorTab = (props: ConsultationTabProps) => { return ( diff --git a/src/Components/Facility/ConsultationDetails/index.tsx b/src/Components/Facility/ConsultationDetails/index.tsx index cac822d76c4..53e137d12eb 100644 --- a/src/Components/Facility/ConsultationDetails/index.tsx +++ b/src/Components/Facility/ConsultationDetails/index.tsx @@ -6,7 +6,7 @@ import { listAssetBeds, } from "../../../Redux/actions"; import { statusType, useAbortableEffect } from "../../../Common/utils"; -import { lazy, useCallback, useState } from "react"; +import { useCallback, useState } from "react"; import DoctorVideoSlideover from "../DoctorVideoSlideover"; import { PatientModel } from "../../Patient/models"; import { @@ -46,8 +46,8 @@ import { CameraFeedPermittedUserTypes } from "../../../Utils/permissions"; import Error404 from "../../ErrorPages/404"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../../Common/Loading")); -const PageTitle = lazy(() => import("../../Common/PageTitle")); +import Loading from "@/Components/Common/Loading"; +import PageTitle from "@/Components/Common/PageTitle"; export interface ConsultationTabProps { consultationId: string; diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 06b50d69912..ef3d7daa781 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -15,7 +15,7 @@ import { FieldErrorText, FieldLabel } from "../Form/FormFields/FormField"; import InvestigationBuilder, { InvestigationType, } from "../Common/prescription-builder/InvestigationBuilder"; -import { LegacyRef, createRef, lazy, useEffect, useRef, useState } from "react"; +import { LegacyRef, createRef, useEffect, useRef, useState } from "react"; import ProcedureBuilder, { ProcedureType, } from "../Common/prescription-builder/ProcedureBuilder"; @@ -66,8 +66,8 @@ import { } from "../Symptoms/SymptomsBuilder.js"; import careConfig from "@careConfig"; -const Loading = lazy(() => import("../Common/Loading")); -const PageTitle = lazy(() => import("../Common/PageTitle")); +import Loading from "@/Components/Common/Loading"; +import PageTitle from "@/Components/Common/PageTitle"; type BooleanStrings = "true" | "false"; diff --git a/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx b/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx index 271c39709ad..e6d45c706af 100644 --- a/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx +++ b/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx @@ -8,7 +8,7 @@ import { PAGINATION_LIMIT } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; import CareIcon from "../../../CAREUI/icons/CareIcon"; import { PainDiagrams } from "./PainDiagrams"; -import PageTitle from "../../Common/PageTitle"; +import PageTitle from "@/Components/Common/PageTitle"; import dayjs from "../../../Utils/dayjs"; import { meanArterialPressure } from "../../Common/BloodPressureFormField"; import { PrimaryParametersPlotFields } from "../models"; diff --git a/src/Components/Facility/FacilityConfigure.tsx b/src/Components/Facility/FacilityConfigure.tsx index 320cbd7ecc5..2d948bb9cf7 100644 --- a/src/Components/Facility/FacilityConfigure.tsx +++ b/src/Components/Facility/FacilityConfigure.tsx @@ -1,4 +1,4 @@ -import { lazy, useReducer, useState } from "react"; +import { useReducer, useState } from "react"; import * as Notification from "../../Utils/Notifications.js"; import { navigate } from "raviger"; import { Submit } from "../Common/components/ButtonV2"; @@ -10,8 +10,7 @@ import routes from "../../Redux/api"; import request from "../../Utils/request/request"; import { FieldChangeEvent } from "../Form/FormFields/Utils.js"; import { t } from "i18next"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const initForm = { name: "", state: 0, diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx index e9e95fbcdfc..c68aa9ec0db 100644 --- a/src/Components/Facility/FacilityCreate.tsx +++ b/src/Components/Facility/FacilityCreate.tsx @@ -23,7 +23,7 @@ import { PopoverPanel, Transition, } from "@headlessui/react"; -import { lazy, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import Steps, { Step } from "../Common/Steps"; import { getPincodeDetails, @@ -65,8 +65,7 @@ import useAuthUser from "../../Common/hooks/useAuthUser"; import SpokeFacilityEditor from "./SpokeFacilityEditor.js"; import careConfig from "@careConfig"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface FacilityProps { facilityId?: string; } diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index 34cada9f239..7edbb939b8a 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -4,7 +4,7 @@ import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import { FacilityModel } from "./models"; import { FACILITY_FEATURE_TYPES, USER_TYPES } from "../../Common/constants"; import DropdownMenu, { DropdownItem } from "../Common/components/Menu"; -import { lazy, useState } from "react"; +import { useState } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import CareIcon from "../../CAREUI/icons/CareIcon"; @@ -42,8 +42,7 @@ type Props = { facilityId: string; }; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export const getFacilityFeatureIcon = (featureId: number) => { const feature = FACILITY_FEATURE_TYPES.find((f) => f.id === featureId); if (!feature?.icon) return null; diff --git a/src/Components/Facility/FacilityUsers.tsx b/src/Components/Facility/FacilityUsers.tsx index 2572731f720..92cc4b35d10 100644 --- a/src/Components/Facility/FacilityUsers.tsx +++ b/src/Components/Facility/FacilityUsers.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import CountBlock from "../../CAREUI/display/Count"; import CareIcon from "../../CAREUI/icons/CareIcon"; import { RESULTS_PER_PAGE_LIMIT } from "../../Common/constants"; @@ -17,8 +17,7 @@ import useQuery from "../../Utils/request/useQuery"; import { UserFacilities } from "../Users/ManageUsers"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function FacilityUsers(props: any) { const { t } = useTranslation(); const { facilityId } = props; diff --git a/src/Components/Facility/HospitalList.tsx b/src/Components/Facility/HospitalList.tsx index ca67fd0eb2c..e7949440307 100644 --- a/src/Components/Facility/HospitalList.tsx +++ b/src/Components/Facility/HospitalList.tsx @@ -1,4 +1,4 @@ -import { lazy, useEffect } from "react"; +import { useEffect } from "react"; import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover"; import CountBlock from "../../CAREUI/display/Count"; import ExportMenu from "../Common/Export"; @@ -17,8 +17,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import CareIcon from "../../CAREUI/icons/CareIcon"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export const HospitalList = () => { const { qParams, diff --git a/src/Components/Facility/InventoryList.tsx b/src/Components/Facility/InventoryList.tsx index fe7e846630d..c7f11f6d3bc 100644 --- a/src/Components/Facility/InventoryList.tsx +++ b/src/Components/Facility/InventoryList.tsx @@ -1,4 +1,4 @@ -import { useState, lazy } from "react"; +import { useState } from "react"; import { navigate } from "raviger"; import Pagination from "../Common/Pagination"; import { classNames } from "../../Utils/utils"; @@ -7,8 +7,7 @@ import ButtonV2 from "../Common/components/ButtonV2"; import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function InventoryList(props: any) { const { facilityId }: any = props; let inventoryItem: any = null; diff --git a/src/Components/Facility/InventoryLog.tsx b/src/Components/Facility/InventoryLog.tsx index b8b1ed71e31..0450801f4b0 100644 --- a/src/Components/Facility/InventoryLog.tsx +++ b/src/Components/Facility/InventoryLog.tsx @@ -1,4 +1,4 @@ -import { useState, lazy } from "react"; +import { useState } from "react"; import * as Notification from "../../Utils/Notifications.js"; import Pagination from "../Common/Pagination"; @@ -10,8 +10,7 @@ import useQuery from "../../Utils/request/useQuery.js"; import routes from "../../Redux/api.js"; import request from "../../Utils/request/request.js"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function InventoryLog(props: any) { const { facilityId, inventoryId }: any = props; const [saving, setSaving] = useState(false); diff --git a/src/Components/Facility/Investigations/ShowInvestigation.tsx b/src/Components/Facility/Investigations/ShowInvestigation.tsx index d7def1af6cc..bc0621af7d9 100644 --- a/src/Components/Facility/Investigations/ShowInvestigation.tsx +++ b/src/Components/Facility/Investigations/ShowInvestigation.tsx @@ -1,6 +1,6 @@ import * as _ from "lodash-es"; import { navigate } from "raviger"; -import { lazy, useCallback, useReducer } from "react"; +import { useCallback, useReducer } from "react"; import routes from "../../../Redux/api"; import * as Notification from "../../../Utils/Notifications.js"; import request from "../../../Utils/request/request"; @@ -8,8 +8,7 @@ import useQuery from "../../../Utils/request/useQuery"; import InvestigationTable from "./InvestigationTable"; import PrintPreview from "../../../CAREUI/misc/PrintPreview"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const initialState = { changedFields: {}, initialValues: {}, diff --git a/src/Components/Facility/Investigations/ViewInvestigations.tsx b/src/Components/Facility/Investigations/ViewInvestigations.tsx index 96156fa5d74..22c811f41fa 100644 --- a/src/Components/Facility/Investigations/ViewInvestigations.tsx +++ b/src/Components/Facility/Investigations/ViewInvestigations.tsx @@ -1,14 +1,12 @@ import { navigate } from "raviger"; import ReportTable from "./Reports/ReportTable"; -import { lazy } from "react"; import { useTranslation } from "react-i18next"; import { formatDateTime } from "../../../Utils/utils"; import { InvestigationResponse } from "./Reports/types"; import { InvestigationSessionType } from "./investigationsTab"; -const Loading = lazy(() => import("../../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function ViewInvestigations(props: { isLoading: boolean; investigations: InvestigationResponse; diff --git a/src/Components/Facility/Investigations/index.tsx b/src/Components/Facility/Investigations/index.tsx index b64e2995e19..df93c7945c6 100644 --- a/src/Components/Facility/Investigations/index.tsx +++ b/src/Components/Facility/Investigations/index.tsx @@ -1,5 +1,5 @@ import { navigate, useQueryParams } from "raviger"; -import { lazy, useEffect, useReducer, useState } from "react"; +import { useEffect, useReducer, useState } from "react"; import * as Notification from "../../../Utils/Notifications.js"; import { TestTable } from "./Table"; @@ -12,8 +12,7 @@ import { Submit } from "../../Common/components/ButtonV2"; import Page from "../../Common/components/Page"; import AutocompleteMultiSelectFormField from "../../Form/FormFields/AutocompleteMultiselect"; -const Loading = lazy(() => import("../../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const initialState = { form: {}, }; diff --git a/src/Components/Facility/LocationManagement.tsx b/src/Components/Facility/LocationManagement.tsx index 83bf335aff2..8df40d9c5f2 100644 --- a/src/Components/Facility/LocationManagement.tsx +++ b/src/Components/Facility/LocationManagement.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import ButtonV2, { Cancel } from "../Common/components/ButtonV2"; import AuthorizeFor, { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import CareIcon from "../../CAREUI/icons/CareIcon"; @@ -14,8 +14,7 @@ import DialogModal from "../Common/Dialog"; import Uptime from "../Common/Uptime"; import useAuthUser from "../../Common/hooks/useAuthUser"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface Props { facilityId: string; } diff --git a/src/Components/Facility/MinQuantityList.tsx b/src/Components/Facility/MinQuantityList.tsx index 528f03cbac7..eeff6a7fed4 100644 --- a/src/Components/Facility/MinQuantityList.tsx +++ b/src/Components/Facility/MinQuantityList.tsx @@ -1,4 +1,4 @@ -import { useState, lazy } from "react"; +import { useState } from "react"; import Pagination from "../Common/Pagination"; import { MinQuantityRequiredModal } from "./MinQuantityRequiredModal"; import ButtonV2 from "../Common/components/ButtonV2"; @@ -6,8 +6,7 @@ import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import Page from "../Common/components/Page"; import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function MinQuantityList(props: any) { const { facilityId }: any = props; let inventoryItem: any = null; diff --git a/src/Components/Facility/TriageForm.tsx b/src/Components/Facility/TriageForm.tsx index 1aa0537b53c..4413d9a48db 100644 --- a/src/Components/Facility/TriageForm.tsx +++ b/src/Components/Facility/TriageForm.tsx @@ -2,7 +2,7 @@ import ConfirmDialog from "../Common/ConfirmDialog"; import Card from "../../CAREUI/display/Card"; import CareIcon from "../../CAREUI/icons/CareIcon"; -import { useReducer, useState, lazy } from "react"; +import { useReducer, useState } from "react"; import * as Notification from "../../Utils/Notifications.js"; import TextFormField from "../Form/FormFields/TextFormField"; import { PatientStatsModel } from "./models"; @@ -10,7 +10,7 @@ import { Cancel, Submit } from "../Common/components/ButtonV2"; import useAppHistory from "../../Common/hooks/useAppHistory"; import DateFormField from "../Form/FormFields/DateFormField"; import { FieldChangeEvent } from "../Form/FormFields/Utils"; -const Loading = lazy(() => import("../Common/Loading")); +import Loading from "@/Components/Common/Loading"; import Page from "../Common/components/Page"; import dayjs from "dayjs"; import { dateQueryString, scrollTo } from "../../Utils/utils"; diff --git a/src/Components/Medicine/MedicinePrescriptionSummary.tsx b/src/Components/Medicine/MedicinePrescriptionSummary.tsx index 7e0ea3ee244..929c70d7e59 100644 --- a/src/Components/Medicine/MedicinePrescriptionSummary.tsx +++ b/src/Components/Medicine/MedicinePrescriptionSummary.tsx @@ -2,14 +2,12 @@ import MedicineRoutes from "../Medicine/routes"; import useQuery from "../../Utils/request/useQuery"; import DialogModal from "../Common/Dialog"; import { useState } from "react"; -import { lazy } from "react"; import Timeline, { TimelineNode } from "../../CAREUI/display/Timeline"; import { MedibaseMedicine, Prescription } from "../Medicine/models"; import { useTranslation } from "react-i18next"; import { humanizeStrings } from "../../Utils/utils"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface MedicinePrescriptionSummaryProps { consultation: string; } diff --git a/src/Components/Patient/DailyRoundListDetails.tsx b/src/Components/Patient/DailyRoundListDetails.tsx index eb7eda62064..db68bc734d7 100644 --- a/src/Components/Patient/DailyRoundListDetails.tsx +++ b/src/Components/Patient/DailyRoundListDetails.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import { DailyRoundsModel } from "./models"; import Page from "../Common/components/Page"; import ButtonV2 from "../Common/components/ButtonV2"; @@ -6,8 +6,7 @@ import { formatDateTime } from "../../Utils/utils"; import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export const DailyRoundListDetails = (props: any) => { const { t } = useTranslation(); const { facilityId, patientId, consultationId, id } = props; diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index ef1281fb62b..bf25d48f6bf 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -1,7 +1,7 @@ import { navigate } from "raviger"; import dayjs from "dayjs"; -import { lazy, useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { APPETITE_CHOICES, BLADDER_DRAINAGE_CHOICES, @@ -58,8 +58,7 @@ import { scrollTo } from "../../Utils/utils"; import { ICD11DiagnosisModel } from "../Facility/models"; import NursingCare from "../LogUpdate/Sections/NursingCare"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export const DailyRounds = (props: any) => { const { t } = useTranslation(); const authUser = useAuthUser(); diff --git a/src/Components/Patient/InsuranceDetails.tsx b/src/Components/Patient/InsuranceDetails.tsx index 9f9fe8507ae..f8bd4473c5f 100644 --- a/src/Components/Patient/InsuranceDetails.tsx +++ b/src/Components/Patient/InsuranceDetails.tsx @@ -1,12 +1,10 @@ import { HCXPolicyModel } from "../HCX/models"; import { InsuranceDetialsCard } from "./InsuranceDetailsCard"; import Page from "../Common/components/Page"; -import { lazy } from "react"; import routes from "../../Redux/api"; import useQuery from "../../Utils/request/useQuery"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface IProps { facilityId: string; id: string; diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx index b5f728d88b0..3f15544a50a 100644 --- a/src/Components/Patient/ManagePatients.tsx +++ b/src/Components/Patient/ManagePatients.tsx @@ -12,7 +12,7 @@ import { } from "../../Common/constants"; import { FacilityModel, PatientCategory } from "../Facility/models"; import { Link, navigate } from "raviger"; -import { ReactNode, lazy, useEffect, useState } from "react"; +import { ReactNode, useEffect, useState } from "react"; import { parseOptionId } from "../../Common/utils"; import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover"; @@ -55,8 +55,7 @@ import Tabs from "../Common/components/Tabs.js"; import request from "../../Utils/request/request.js"; import { Avatar } from "../Common/Avatar.js"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface TabPanelProps { children?: ReactNode; dir?: string; diff --git a/src/Components/Patient/PatientHome.tsx b/src/Components/Patient/PatientHome.tsx index 223e0bb1bc0..2ee78b6bce1 100644 --- a/src/Components/Patient/PatientHome.tsx +++ b/src/Components/Patient/PatientHome.tsx @@ -16,7 +16,7 @@ import { isAntenatal, isPostPartum, } from "../../Utils/utils"; -import { lazy, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import CareIcon from "../../CAREUI/icons/CareIcon"; @@ -43,8 +43,7 @@ import { useTranslation } from "react-i18next"; import { Alert, AlertDescription, AlertTitle } from "@/Components/ui/alert"; import { Button } from "@/Components/ui/button"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export const parseOccupation = (occupation: string | undefined) => { return OCCUPATION_TYPES.find((i) => i.value === occupation)?.text; }; diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index 3eb9590659c..8e9a284f7e5 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -25,7 +25,7 @@ import { parsePhoneNumber, scrollTo, } from "../../Utils/utils"; -import { lazy, useCallback, useReducer, useRef, useState } from "react"; +import { useCallback, useReducer, useRef, useState } from "react"; import { navigate } from "raviger"; import { statusType, useAbortableEffect } from "../../Common/utils"; @@ -68,8 +68,8 @@ import { validatePincode } from "../../Common/validation"; import careConfig from "@careConfig"; import { Button } from "@/Components/ui/button"; -const Loading = lazy(() => import("../Common/Loading")); -const PageTitle = lazy(() => import("../Common/PageTitle")); +import Loading from "@/Components/Common/Loading"; +import PageTitle from "@/Components/Common/PageTitle"; type PatientForm = PatientModel & PatientMeta & { age?: number; is_postpartum?: boolean }; diff --git a/src/Components/Patient/SampleDetails.tsx b/src/Components/Patient/SampleDetails.tsx index 343927733ca..a80ca515122 100644 --- a/src/Components/Patient/SampleDetails.tsx +++ b/src/Components/Patient/SampleDetails.tsx @@ -1,6 +1,5 @@ import { FlowModel } from "./models"; import { GENDER_TYPES, TEST_TYPE_CHOICES } from "../../Common/constants"; -import { lazy } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import Card from "../../CAREUI/display/Card"; @@ -14,8 +13,7 @@ import { DetailRoute } from "../../Routers/types"; import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export const SampleDetails = ({ id }: DetailRoute) => { const { loading: isLoading, data: sampleDetails } = useQuery( routes.getTestSample, diff --git a/src/Components/Patient/SamplePreview.tsx b/src/Components/Patient/SamplePreview.tsx index f56714f0c36..3e692d4d43a 100644 --- a/src/Components/Patient/SamplePreview.tsx +++ b/src/Components/Patient/SamplePreview.tsx @@ -1,14 +1,11 @@ import { classNames, formatDateTime, humanizeStrings } from "../../Utils/utils"; -import { lazy } from "react"; - import ButtonV2 from "../Common/components/ButtonV2"; import Page from "../Common/components/Page"; import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface ISamplePreviewProps { id: string; sampleId: string; diff --git a/src/Components/Patient/SampleTest.tsx b/src/Components/Patient/SampleTest.tsx index 6734ed03f0d..b4d36da74b6 100644 --- a/src/Components/Patient/SampleTest.tsx +++ b/src/Components/Patient/SampleTest.tsx @@ -1,6 +1,6 @@ import { navigate } from "raviger"; -import { useReducer, useState, lazy } from "react"; +import { useReducer, useState } from "react"; import { SAMPLE_TYPE_CHOICES, ICMR_CATEGORY } from "../../Common/constants"; import * as Notification from "../../Utils/Notifications.js"; import { SampleTestModel } from "./models"; @@ -17,8 +17,7 @@ import { FacilitySelect } from "../Common/FacilitySelect"; import request from "../../Utils/request/request"; import routes from "../../Redux/api"; import useQuery from "../../Utils/request/useQuery"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; const initForm: SampleTestModel = { isFastTrack: false, fast_track: "", diff --git a/src/Components/Patient/SampleViewAdmin.tsx b/src/Components/Patient/SampleViewAdmin.tsx index ced7e1a96ba..2361d2a697a 100644 --- a/src/Components/Patient/SampleViewAdmin.tsx +++ b/src/Components/Patient/SampleViewAdmin.tsx @@ -1,6 +1,6 @@ import SampleFilter from "./SampleFilters"; import { navigate } from "raviger"; -import { useState, lazy } from "react"; +import { useState } from "react"; import { SAMPLE_TEST_STATUS, SAMPLE_TEST_RESULT, @@ -22,8 +22,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function SampleViewAdmin() { const { qParams, diff --git a/src/Components/Patient/ShiftCreate.tsx b/src/Components/Patient/ShiftCreate.tsx index c3b01ad189d..17d627d982c 100644 --- a/src/Components/Patient/ShiftCreate.tsx +++ b/src/Components/Patient/ShiftCreate.tsx @@ -7,7 +7,7 @@ import { SHIFTING_VEHICLE_CHOICES, } from "../../Common/constants"; import { Cancel, Submit } from "../Common/components/ButtonV2"; -import { lazy, useReducer, useState } from "react"; +import { useReducer, useState } from "react"; import { FacilitySelect } from "../Common/FacilitySelect"; import { FieldChangeEvent } from "../Form/FormFields/Utils"; @@ -31,8 +31,7 @@ import routes from "../../Redux/api.js"; import request from "../../Utils/request/request.js"; import careConfig from "@careConfig"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface patientShiftProps { facilityId: string; patientId: string; diff --git a/src/Components/Resource/ListView.tsx b/src/Components/Resource/ListView.tsx index 11362f54891..31b34065aa5 100644 --- a/src/Components/Resource/ListView.tsx +++ b/src/Components/Resource/ListView.tsx @@ -1,4 +1,3 @@ -import { lazy } from "react"; import { navigate } from "raviger"; import ListFilter from "./ListFilter"; import { formatFilter } from "./Commons"; @@ -17,8 +16,7 @@ import Page from "../Common/components/Page"; import SearchInput from "../Form/SearchInput"; import request from "../../Utils/request/request"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function ListView() { const { qParams, diff --git a/src/Components/Resource/ResourceBoardView.tsx b/src/Components/Resource/ResourceBoardView.tsx index 345cd11c381..bd28cc5f5d2 100644 --- a/src/Components/Resource/ResourceBoardView.tsx +++ b/src/Components/Resource/ResourceBoardView.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import { navigate } from "raviger"; import ListFilter from "./ListFilter"; import ResourceBoard from "./ResourceBoard"; @@ -17,8 +17,8 @@ import Tabs from "../Common/components/Tabs"; import request from "../../Utils/request/request"; import routes from "../../Redux/api"; -const Loading = lazy(() => import("../Common/Loading")); -const PageTitle = lazy(() => import("../Common/PageTitle")); +import Loading from "@/Components/Common/Loading"; +import PageTitle from "@/Components/Common/PageTitle"; const ScrollingComponent = withScrolling("div"); const resourceStatusOptions = RESOURCE_CHOICES.map((obj) => obj.text); diff --git a/src/Components/Resource/ResourceCreate.tsx b/src/Components/Resource/ResourceCreate.tsx index ebdb83e90bb..ec41e6c9175 100644 --- a/src/Components/Resource/ResourceCreate.tsx +++ b/src/Components/Resource/ResourceCreate.tsx @@ -1,4 +1,4 @@ -import { useReducer, useState, lazy } from "react"; +import { useReducer, useState } from "react"; import { FacilitySelect } from "../Common/FacilitySelect"; import * as Notification from "../../Utils/Notifications.js"; @@ -27,8 +27,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface resourceProps { facilityId: number; } diff --git a/src/Components/Resource/ResourceDetails.tsx b/src/Components/Resource/ResourceDetails.tsx index 652f71344c7..de024f46f41 100644 --- a/src/Components/Resource/ResourceDetails.tsx +++ b/src/Components/Resource/ResourceDetails.tsx @@ -1,4 +1,4 @@ -import { useState, lazy } from "react"; +import { useState } from "react"; import { classNames, formatDateTime, formatName } from "../../Utils/utils"; import { navigate } from "raviger"; import * as Notification from "../../Utils/Notifications.js"; @@ -10,8 +10,7 @@ import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; import CareIcon from "../../CAREUI/icons/CareIcon"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function ResourceDetails(props: { id: string }) { const [isPrintMode, setIsPrintMode] = useState(false); const [openDeleteResourceDialog, setOpenDeleteResourceDialog] = diff --git a/src/Components/Resource/ResourceDetailsUpdate.tsx b/src/Components/Resource/ResourceDetailsUpdate.tsx index 6d293f05df5..7aac3031274 100644 --- a/src/Components/Resource/ResourceDetailsUpdate.tsx +++ b/src/Components/Resource/ResourceDetailsUpdate.tsx @@ -1,6 +1,6 @@ import * as Notification from "../../Utils/Notifications.js"; import { Cancel, Submit } from "../Common/components/ButtonV2"; -import { lazy, useReducer, useState } from "react"; +import { useReducer, useState } from "react"; import { navigate, useQueryParams } from "raviger"; import Card from "../../CAREUI/display/Card"; import CircularProgress from "../Common/components/CircularProgress"; @@ -20,8 +20,7 @@ import routes from "../../Redux/api.js"; import { UserModel } from "../Users/models.js"; import request from "../../Utils/request/request.js"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface resourceProps { id: string; } diff --git a/src/Components/Shifting/BoardView.tsx b/src/Components/Shifting/BoardView.tsx index f303df72d99..dbd911483dc 100644 --- a/src/Components/Shifting/BoardView.tsx +++ b/src/Components/Shifting/BoardView.tsx @@ -12,7 +12,7 @@ import { formatFilter } from "./Commons"; import { navigate } from "raviger"; import useFilters from "../../Common/hooks/useFilters"; -import { lazy, useLayoutEffect, useRef, useState } from "react"; +import { useLayoutEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import withScrolling from "react-dnd-scrolling"; import ButtonV2 from "../Common/components/ButtonV2"; @@ -23,8 +23,8 @@ import careConfig from "@careConfig"; import request from "../../Utils/request/request"; import routes from "../../Redux/api"; -const Loading = lazy(() => import("../Common/Loading")); -const PageTitle = lazy(() => import("../Common/PageTitle")); +import Loading from "@/Components/Common/Loading"; +import PageTitle from "@/Components/Common/PageTitle"; const ScrollingComponent = withScrolling("div"); export default function BoardView() { diff --git a/src/Components/Shifting/ListView.tsx b/src/Components/Shifting/ListView.tsx index b40b42dc979..1e069d9e37f 100644 --- a/src/Components/Shifting/ListView.tsx +++ b/src/Components/Shifting/ListView.tsx @@ -1,4 +1,4 @@ -import { lazy, useState } from "react"; +import { useState } from "react"; import BadgesList from "./BadgesList"; import ButtonV2 from "../Common/components/ButtonV2"; import ConfirmDialog from "../Common/ConfirmDialog"; @@ -20,8 +20,7 @@ import routes from "../../Redux/api"; import useQuery from "../../Utils/request/useQuery"; import careConfig from "@careConfig"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function ListView() { const { qParams, diff --git a/src/Components/Shifting/ShiftDetails.tsx b/src/Components/Shifting/ShiftDetails.tsx index 5790f59cb05..cc39e048e89 100644 --- a/src/Components/Shifting/ShiftDetails.tsx +++ b/src/Components/Shifting/ShiftDetails.tsx @@ -6,7 +6,7 @@ import { SHIFTING_CHOICES_WARTIME, } from "../../Common/constants"; import { Link, navigate } from "raviger"; -import { lazy, useState } from "react"; +import { useState } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import CommentSection from "./CommentsSection"; import ConfirmDialog from "../Common/ConfirmDialog.js"; @@ -29,8 +29,7 @@ import CareIcon from "../../CAREUI/icons/CareIcon.js"; import { PatientModel } from "../Patient/models.js"; import careConfig from "@careConfig"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function ShiftDetails(props: { id: string }) { const [isPrintMode, setIsPrintMode] = useState(false); const [isCopied, setIsCopied] = useState(false); diff --git a/src/Components/Shifting/ShiftDetailsUpdate.tsx b/src/Components/Shifting/ShiftDetailsUpdate.tsx index ccf808ecda9..64a7d1af110 100644 --- a/src/Components/Shifting/ShiftDetailsUpdate.tsx +++ b/src/Components/Shifting/ShiftDetailsUpdate.tsx @@ -12,7 +12,7 @@ import { } from "../../Common/constants"; import { Cancel, Submit } from "../Common/components/ButtonV2"; import { navigate, useQueryParams } from "raviger"; -import { lazy, useReducer, useState } from "react"; +import { useReducer, useState } from "react"; import { ConsultationModel } from "../Facility/models.js"; import DischargeModal from "../Facility/DischargeModal.js"; import { FacilitySelect } from "../Common/FacilitySelect"; @@ -40,8 +40,7 @@ import { PatientModel } from "../Patient/models.js"; import useAuthUser from "../../Common/hooks/useAuthUser.js"; import careConfig from "@careConfig"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; interface patientShiftProps { id: string; } diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx index 88069ca5e29..2a00a2a8305 100644 --- a/src/Components/Users/ManageUsers.tsx +++ b/src/Components/Users/ManageUsers.tsx @@ -1,6 +1,6 @@ import dayjs from "dayjs"; import { navigate } from "raviger"; -import { lazy, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import CountBlock from "../../CAREUI/display/Count"; import CareIcon from "../../CAREUI/icons/CareIcon"; @@ -37,8 +37,7 @@ import UserDeleteDialog from "./UserDeleteDialog"; import UserFilter from "./UserFilter"; import { showUserDelete } from "../../Utils/permissions"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; export default function ManageUsers() { const { t } = useTranslation(); const { width } = useWindowDimensions(); diff --git a/src/Components/Users/UserAdd.tsx b/src/Components/Users/UserAdd.tsx index 73c7fb63c26..855e2cb8f9a 100644 --- a/src/Components/Users/UserAdd.tsx +++ b/src/Components/Users/UserAdd.tsx @@ -1,5 +1,5 @@ import { Link, navigate } from "raviger"; -import { lazy, useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { GENDER_TYPES, USER_TYPES, @@ -43,7 +43,7 @@ import CareIcon from "../../CAREUI/icons/CareIcon"; import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); +import Loading from "@/Components/Common/Loading"; interface UserProps { userId?: number; } diff --git a/src/Components/Users/UserProfile.tsx b/src/Components/Users/UserProfile.tsx index 667abc942ec..b9af5b98f65 100644 --- a/src/Components/Users/UserProfile.tsx +++ b/src/Components/Users/UserProfile.tsx @@ -1,4 +1,4 @@ -import { useState, useReducer, lazy, FormEvent } from "react"; +import { useState, useReducer, FormEvent } from "react"; import { GENDER_TYPES } from "../../Common/constants"; import { validateEmailAddress } from "../../Common/validation"; import * as Notification from "../../Utils/Notifications.js"; @@ -27,8 +27,7 @@ import request from "../../Utils/request/request"; import DateFormField from "../Form/FormFields/DateFormField"; import { validateRule } from "./UserAdd"; import { useTranslation } from "react-i18next"; -const Loading = lazy(() => import("../Common/Loading")); - +import Loading from "@/Components/Common/Loading"; type EditForm = { firstName: string; lastName: string;