diff --git a/app/owner/properties/page.js b/app/owner/properties/page.js index 952c05a..07ba4d6 100644 --- a/app/owner/properties/page.js +++ b/app/owner/properties/page.js @@ -35,10 +35,10 @@ import { Cigarette, Dog, Music, - Sofa, - DoorOpen, Warehouse, Layers, + Sofa, + DoorOpen, Wind, Pencil, Save, @@ -749,7 +749,7 @@ export default function OwnerPropertiesPage() { propertyType: { 0: 'apartment', 1: 'villa', 2: 'sweet', 3: 'room', 4: 'studio', 5: 'office', 6: 'farms', 7: 'shop', 8: 'warehouse' }[info.buildingType] || 'apartment', propertyTypeLabel: { 0: 'شقة', 1: 'فيلا', 2: 'سويت', 3: 'غرفة', 4: 'استوديو', 5: 'مكتب', 6: 'مزرعة', 7: 'متجر', 8: 'مستودع' }[info.buildingType] || 'عقار', purpose: 'rent', - rentType: { 0: 'daily', 1: 'monthly' }[item.rentType] || 'daily', + rentType: item.rentType === 0 ? 'monthly' : item.rentType === 1 ? 'daily' : 'daily', dailyPrice: item.dailyRent || 0, monthlyPrice: item.monthlyRent || 0, salePrice: item.price || 0, @@ -759,6 +759,9 @@ export default function OwnerPropertiesPage() { bathrooms: info.numberOfBathRooms || 0, area: info.space || 0, livingRooms: details.livingRooms || 0, + floor: details.floorNumber ?? details.floor ?? 0, + salons: details.numberOfSalons ?? details.salonsCount ?? details.salons ?? 0, + balconies: details.numberOfBalconies ?? details.balconiesCount ?? details.balconies ?? 0, status: { 0: 'available', 1: 'booked', 2: 'maintenance' }[info.status] || 'available', images: raw.length > 0 ? raw.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) : ['/property-placeholder.jpg'], createdAt: item.createdAt || new Date().toISOString(), @@ -795,6 +798,9 @@ export default function OwnerPropertiesPage() { bathrooms: info.numberOfBathRooms || 0, area: info.space || 0, livingRooms: details.livingRooms || 0, + floor: details.floorNumber ?? details.floor ?? 0, + salons: details.numberOfSalons ?? details.salonsCount ?? details.salons ?? 0, + balconies: details.numberOfBalconies ?? details.balconiesCount ?? details.balconies ?? 0, status: 'available', images: raw.length > 0 ? raw.map(img => img.startsWith('http') ? img : `${apiBase}${img.startsWith('/') ? '' : '/Pictures/'}${img}`) : ['/property-placeholder.jpg'], createdAt: item.createdAt || new Date().toISOString(), @@ -1090,7 +1096,7 @@ export default function OwnerPropertiesPage() { {property.address || property.location || 'موقع غير محدد'} -
+
{property.bedrooms} @@ -1103,10 +1109,28 @@ export default function OwnerPropertiesPage() { {property.area}م²
+ {property.floor > 0 && ( +
+ + ط {property.floor} +
+ )} + {property.salons > 0 && ( +
+ + {property.salons} +
+ )} + {property.balconies > 0 && ( +
+ + {property.balconies} +
+ )} {property.rating > 0 && (
- {property.rating.toFixed(1)} + {Number(property.rating).toFixed(1)}
)}
@@ -1114,17 +1138,28 @@ export default function OwnerPropertiesPage() {
{property.purpose === 'rent' ? ( -
- {property.dailyPrice && ( - - {Number(property.dailyPrice).toLocaleString()} ل.س +
+ {property.rentType === 'monthly' && property.monthlyPrice > 0 && ( + + {Number(property.monthlyPrice).toLocaleString()} + ل.س /شهر )} - - {property.rentType === 'daily' ? '/يوم' : - property.rentType === 'monthly' ? '/شهر' : - property.dailyPrice && property.monthlyPrice ? '/يوم وشهر' : ''} - + {property.rentType === 'daily' && property.dailyPrice > 0 && ( + + {Number(property.dailyPrice).toLocaleString()} + ل.س /يوم + + )} + {property.rentType === 'daily' && property.monthlyPrice > 0 && ( + + {Number(property.monthlyPrice).toLocaleString()} + ل.س /شهر + + )} + {property.deposit > 0 && ( + تأمين: {Number(property.deposit).toLocaleString()} + )}
) : (