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 42s
All checks were successful
Build frontend / build (push) Successful in 42s
This commit is contained in:
@ -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 || 'موقع غير محدد'}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3 text-sm text-gray-600 mb-3">
|
||||
<div className="flex flex-wrap items-center gap-3 text-sm text-gray-600 mb-3">
|
||||
<div className="flex items-center gap-1">
|
||||
<Bed className="w-4 h-4" />
|
||||
<span>{property.bedrooms}</span>
|
||||
@ -1103,10 +1109,28 @@ export default function OwnerPropertiesPage() {
|
||||
<Square className="w-4 h-4" />
|
||||
<span>{property.area}م²</span>
|
||||
</div>
|
||||
{property.floor > 0 && (
|
||||
<div className="flex items-center gap-1">
|
||||
<Layers className="w-4 h-4" />
|
||||
<span>ط {property.floor}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.salons > 0 && (
|
||||
<div className="flex items-center gap-1">
|
||||
<Sofa className="w-4 h-4" />
|
||||
<span>{property.salons}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.balconies > 0 && (
|
||||
<div className="flex items-center gap-1">
|
||||
<DoorOpen className="w-4 h-4" />
|
||||
<span>{property.balconies}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.rating > 0 && (
|
||||
<div className="flex items-center gap-1 text-amber-600">
|
||||
<Star className="w-3 h-3 fill-amber-500" />
|
||||
<span>{property.rating.toFixed(1)}</span>
|
||||
<span>{Number(property.rating).toFixed(1)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@ -1114,17 +1138,28 @@ export default function OwnerPropertiesPage() {
|
||||
<div className="flex justify-between items-center pt-3 border-t border-gray-100">
|
||||
<div>
|
||||
{property.purpose === 'rent' ? (
|
||||
<div>
|
||||
{property.dailyPrice && (
|
||||
<span className="text-lg font-bold text-amber-600">
|
||||
{Number(property.dailyPrice).toLocaleString()} ل.س
|
||||
<div className="flex flex-wrap items-center gap-x-3">
|
||||
{property.rentType === 'monthly' && property.monthlyPrice > 0 && (
|
||||
<span>
|
||||
<span className="text-lg font-bold text-amber-600">{Number(property.monthlyPrice).toLocaleString()}</span>
|
||||
<span className="text-xs text-gray-500 mr-1">ل.س /شهر</span>
|
||||
</span>
|
||||
)}
|
||||
<span className="text-xs text-gray-500 mr-1">
|
||||
{property.rentType === 'daily' ? '/يوم' :
|
||||
property.rentType === 'monthly' ? '/شهر' :
|
||||
property.dailyPrice && property.monthlyPrice ? '/يوم وشهر' : ''}
|
||||
</span>
|
||||
{property.rentType === 'daily' && property.dailyPrice > 0 && (
|
||||
<span>
|
||||
<span className="text-lg font-bold text-amber-600">{Number(property.dailyPrice).toLocaleString()}</span>
|
||||
<span className="text-xs text-gray-500 mr-1">ل.س /يوم</span>
|
||||
</span>
|
||||
)}
|
||||
{property.rentType === 'daily' && property.monthlyPrice > 0 && (
|
||||
<span>
|
||||
<span className="text-lg font-bold text-amber-600">{Number(property.monthlyPrice).toLocaleString()}</span>
|
||||
<span className="text-xs text-gray-500 mr-1">ل.س /شهر</span>
|
||||
</span>
|
||||
)}
|
||||
{property.deposit > 0 && (
|
||||
<span className="text-xs text-gray-400">تأمين: {Number(property.deposit).toLocaleString()}</span>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user