diff --git a/app/property/[id]/page.js b/app/property/[id]/page.js index 993d40b..2c1191f 100644 --- a/app/property/[id]/page.js +++ b/app/property/[id]/page.js @@ -61,9 +61,15 @@ export async function generateMetadata({ params }) { const p = mapProperty(raw); const priceStr = `${p.price.toLocaleString()} ل.س / ${p.priceUnit === 'daily' ? 'يوم' : 'شهر'}`; - const imageUrl = p.image + const propertyImage = p.image ? (p.image.startsWith('http') ? p.image : `http://45.93.137.91${p.image}`) : ''; + const logoUrl = `http://45.93.137.91/logo.png`; + + // Use property image if available, otherwise logo + const ogImages = propertyImage + ? [{ url: propertyImage, width: 1200, height: 630 }, { url: logoUrl, width: 512, height: 512 }] + : [{ url: logoUrl, width: 512, height: 512 }]; return { title: `${p.title} - ${priceStr}`, @@ -71,8 +77,8 @@ export async function generateMetadata({ params }) { openGraph: { title: `${p.title} - ${priceStr}`, description: p.description, - images: imageUrl ? [imageUrl] : [], - url: `https://sweethome.example/property/${id}`, + images: ogImages, + url: `http://45.93.137.91/property/${id}`, type: 'website', siteName: 'SweetHome', }, @@ -80,7 +86,7 @@ export async function generateMetadata({ params }) { card: 'summary_large_image', title: `${p.title} - ${priceStr}`, description: p.description, - images: imageUrl ? [imageUrl] : [], + images: ogImages.map(i => i.url), }, }; }