fixed my propries page and fixed the sidebar again mouaz is the best in the west
All checks were successful
Build frontend / build (push) Successful in 44s
All checks were successful
Build frontend / build (push) Successful in 44s
This commit is contained in:
@ -254,11 +254,18 @@ const PropertyViewModal = ({ isOpen, onClose, property }) => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{property.services && Object.keys(property.services).length > 0 && (
|
{property.services && (Array.isArray(property.services) ? property.services.length > 0 : Object.keys(property.services).length > 0) && (
|
||||||
<div className="bg-gray-50 p-4 rounded-xl mb-6">
|
<div className="bg-gray-50 p-4 rounded-xl mb-6">
|
||||||
<h4 className="font-bold text-gray-700 mb-3">الخدمات المتوفرة</h4>
|
<h4 className="font-bold text-gray-700 mb-3">الخدمات المتوفرة</h4>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap gap-2">
|
||||||
{Object.entries(property.services).map(([key, value]) => {
|
{Array.isArray(property.services) ? (
|
||||||
|
property.services.map((svc, i) => (
|
||||||
|
<span key={i} className="inline-flex items-center gap-1 px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm">
|
||||||
|
{serviceLabels[svc] || svc}
|
||||||
|
</span>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
Object.entries(property.services).map(([key, value]) => {
|
||||||
if (!value) return null;
|
if (!value) return null;
|
||||||
const detail = typeof value === 'object' && value.detail ? value.detail : null;
|
const detail = typeof value === 'object' && value.detail ? value.detail : null;
|
||||||
return (
|
return (
|
||||||
@ -267,7 +274,8 @@ const PropertyViewModal = ({ isOpen, onClose, property }) => {
|
|||||||
{detail && <span className="text-green-400">· {detail}</span>}
|
{detail && <span className="text-green-400">· {detail}</span>}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
})}
|
})
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -483,11 +483,18 @@ export default function PropertyDetailsPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Services with detail text */}
|
{/* 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) && (
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h3 className="font-bold text-gray-900 mb-2 text-sm">الخدمات</h3>
|
<h3 className="font-bold text-gray-900 mb-2 text-sm">الخدمات</h3>
|
||||||
<div className="flex flex-wrap gap-1.5">
|
<div className="flex flex-wrap gap-1.5">
|
||||||
{Object.entries(property.services).map(([key, val]) => {
|
{Array.isArray(property.services) ? (
|
||||||
|
property.services.map((svc, i) => (
|
||||||
|
<span key={i} className="px-3 py-1 bg-green-50 text-green-700 rounded-full text-sm border border-green-200 flex items-center gap-1">
|
||||||
|
{serviceLabels[svc] || svc}
|
||||||
|
</span>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
Object.entries(property.services).map(([key, val]) => {
|
||||||
if (!val) return null;
|
if (!val) return null;
|
||||||
const detail = typeof val === 'object' && val.detail ? val.detail : null;
|
const detail = typeof val === 'object' && val.detail ? val.detail : null;
|
||||||
return (
|
return (
|
||||||
@ -496,7 +503,8 @@ export default function PropertyDetailsPage() {
|
|||||||
{detail && <span className="text-green-400">· {detail}</span>}
|
{detail && <span className="text-green-400">· {detail}</span>}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
})}
|
})
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user