diff --git a/src/components/layouts/Footer.tsx b/src/components/layouts/Footer.tsx index 33b6881..ebb9f72 100644 --- a/src/components/layouts/Footer.tsx +++ b/src/components/layouts/Footer.tsx @@ -1,18 +1,16 @@ "use client"; -import React, { useEffect, useState } from "react"; + import Image from "next/image"; +import { useEffect } from "react"; import { useLatestPropertyQuery } from "../../services/hooks/property"; +import { formatCurrency } from "@/utils/general"; export default function Footer() { const { data, _fetch } = useLatestPropertyQuery(); - const [isDataFetched, setIsDataFetched] = useState(false); useEffect(() => { - if (!isDataFetched) { - _fetch(); - setIsDataFetched(true); - } - }, [isDataFetched, _fetch]); + _fetch(); + }, []); const latestProperties = data ? data.slice(0, 2) : []; @@ -29,23 +27,14 @@ export default function Footer() { latestProperties.map((property, index) => (
- 0 - ? property.images[0].url - : "/images/featured-properties-17-480x287.jpg" - } - alt={property.title} - width={161} - height={136} - /> + {property.title}
{property.title}
- From ${property.price}/month + From {formatCurrency(property.price)}/month