diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index e659f660981..181c3de816d 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -33,6 +33,10 @@ import { LocationSelect } from "../Common/LocationSelect.js"; import { CameraFeedPermittedUserTypes } from "../../Utils/permissions.js"; import { FacilityStaffList } from "./FacilityStaffList.js"; +type Props = { + facilityId: string; +}; + const Loading = lazy(() => import("../Common/Loading")); export const getFacilityFeatureIcon = (featureId: number) => { @@ -45,12 +49,10 @@ export const getFacilityFeatureIcon = (featureId: number) => { ); }; -export const FacilityHome = (props: any) => { +export const FacilityHome = ({ facilityId }: Props) => { const { t } = useTranslation(); - const { facilityId } = props; const [openDeleteDialog, setOpenDeleteDialog] = useState(false); const [editCoverImage, setEditCoverImage] = useState(false); - const [imageKey, setImageKey] = useState(Date.now()); const authUser = useAuthUser(); useMessageListener((data) => console.log(data)); @@ -107,7 +109,10 @@ export const FacilityHome = (props: any) => { const editCoverImageTooltip = hasPermissionToEditCoverImage && (
setEditCoverImage(true)} > {`${hasCoverImage ? "Edit" : "Upload"}`} @@ -116,7 +121,7 @@ export const FacilityHome = (props: any) => { const CoverImage = () => ( {facilityData?.name} @@ -145,11 +150,7 @@ export const FacilityHome = (props: any) => { /> - facilityData?.read_cover_image_url - ? setImageKey(Date.now()) - : facilityFetch() - } + onSave={() => facilityFetch()} onClose={() => setEditCoverImage(false)} onDelete={() => facilityFetch()} facility={facilityData ?? ({} as FacilityModel)}