diff --git a/app/properties/[id]/page.jsx b/app/properties/[id]/page.jsx index 58c9f3e..1b83199 100644 --- a/app/properties/[id]/page.jsx +++ b/app/properties/[id]/page.jsx @@ -2,6 +2,7 @@ import PropertyHeaderImage from '@/components/PropertyHeaderImage'; import PropertyDetails from '@/components/PropertyDetails'; import connectDB from '@/config/database'; import Property from '@/models/Property'; +import PropertyImages from '@/components/PropertyImages'; const PropertyPage = async ({ params }) => { await connectDB(); @@ -101,6 +102,7 @@ const PropertyPage = async ({ params }) => { + > ); }; diff --git a/components/PropertyImages.jsx b/components/PropertyImages.jsx new file mode 100644 index 0000000..3acf793 --- /dev/null +++ b/components/PropertyImages.jsx @@ -0,0 +1,44 @@ +import Image from 'next/image'; + +const PropertyImages = ({ images }) => { + return ( + + + {images.length === 1 ? ( + + ) : ( + + {images.map((image, index) => ( + + + + ))} + + )} + + + ); +}; + +export default PropertyImages;