import Link from 'next/link'; import PropertyCard from './PropertyCard'; import connectDB from '@/config/database'; import Property from '@/models/Property'; const HomeProperties = async () => { await connectDB(); // Get the 3 latest properties const recentProperties = await Property.find({}) .sort({ createdAt: -1 }) .limit(3) .lean(); return ( <>

Recent Properties

{recentProperties.length === 0 ? (

No Properties Found

) : ( recentProperties.map((property) => ( )) )}
View All Properties
); }; export default HomeProperties;