From af54bded138c8768a50fe355a566a706b4232040 Mon Sep 17 00:00:00 2001
From: mouazkh
Date: Mon, 25 May 2026 22:54:38 +0300
Subject: [PATCH] fixed my propries page and fixed the sidebar again mouaz is
the best in the west
---
app/owner/properties/page.js | 28 ++++++++++++++++++----------
app/property/[id]/PropertyDetail.js | 28 ++++++++++++++++++----------
2 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/app/owner/properties/page.js b/app/owner/properties/page.js
index eb34b16..e9594f3 100644
--- a/app/owner/properties/page.js
+++ b/app/owner/properties/page.js
@@ -254,20 +254,28 @@ const PropertyViewModal = ({ isOpen, onClose, property }) => {
- {property.services && Object.keys(property.services).length > 0 && (
+ {property.services && (Array.isArray(property.services) ? property.services.length > 0 : Object.keys(property.services).length > 0) && (
الخدمات المتوفرة
- {Object.entries(property.services).map(([key, value]) => {
- if (!value) return null;
- const detail = typeof value === 'object' && value.detail ? value.detail : null;
- return (
-
- {serviceLabels[key] || key}
- {detail && · {detail}}
+ {Array.isArray(property.services) ? (
+ property.services.map((svc, i) => (
+
+ {serviceLabels[svc] || svc}
- );
- })}
+ ))
+ ) : (
+ Object.entries(property.services).map(([key, value]) => {
+ if (!value) return null;
+ const detail = typeof value === 'object' && value.detail ? value.detail : null;
+ return (
+
+ {serviceLabels[key] || key}
+ {detail && · {detail}}
+
+ );
+ })
+ )}
)}
diff --git a/app/property/[id]/PropertyDetail.js b/app/property/[id]/PropertyDetail.js
index 84e6573..97ba66c 100644
--- a/app/property/[id]/PropertyDetail.js
+++ b/app/property/[id]/PropertyDetail.js
@@ -483,20 +483,28 @@ export default function PropertyDetailsPage() {
{/* Services with detail text */}
- {Object.keys(property.services).length > 0 && (
+ {property.services && (Array.isArray(property.services) ? property.services.length > 0 : Object.keys(property.services).length > 0) && (
الخدمات
- {Object.entries(property.services).map(([key, val]) => {
- if (!val) return null;
- const detail = typeof val === 'object' && val.detail ? val.detail : null;
- return (
-
- {serviceLabels[key] || key}
- {detail && · {detail}}
+ {Array.isArray(property.services) ? (
+ property.services.map((svc, i) => (
+
+ {serviceLabels[svc] || svc}
- );
- })}
+ ))
+ ) : (
+ Object.entries(property.services).map(([key, val]) => {
+ if (!val) return null;
+ const detail = typeof val === 'object' && val.detail ? val.detail : null;
+ return (
+
+ {serviceLabels[key] || key}
+ {detail && · {detail}}
+
+ );
+ })
+ )}
)}