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:
@ -1076,12 +1076,12 @@ export default function OwnerPropertiesPage() {
|
||||
transition={{ delay: index * 0.1 }}
|
||||
className="bg-white rounded-2xl shadow-sm hover:shadow-md transition-all overflow-hidden border border-gray-200"
|
||||
>
|
||||
<div className="relative h-48 bg-gray-100">
|
||||
<div className="relative aspect-[16/10] bg-gray-100 overflow-hidden">
|
||||
{property.images && property.images.length > 0 ? (
|
||||
<img
|
||||
src={property.images[0]}
|
||||
alt={property.title}
|
||||
className="w-full h-full object-cover"
|
||||
className="w-full h-full object-cover hover:scale-105 transition-transform duration-300"
|
||||
/>
|
||||
) : (
|
||||
<div className="w-full h-full flex items-center justify-center">
|
||||
@ -1089,133 +1089,123 @@ export default function OwnerPropertiesPage() {
|
||||
</div>
|
||||
)}
|
||||
<div className="absolute top-2 right-2 flex gap-1">
|
||||
<span className={`px-2 py-1 rounded-lg text-xs font-medium shadow-sm ${
|
||||
<span className={`px-2 py-0.5 rounded-md text-xs font-medium shadow-sm backdrop-blur-sm ${
|
||||
property.status === 'available'
|
||||
? 'bg-green-100 text-green-800'
|
||||
: 'bg-yellow-100 text-yellow-800'
|
||||
? 'bg-white/90 text-green-700'
|
||||
: 'bg-white/90 text-yellow-700'
|
||||
}`}>
|
||||
{property.status === 'available' ? 'متاح' : 'مؤجر'}
|
||||
</span>
|
||||
{property.purpose === 'rent' && property.furnished && (
|
||||
<span className="px-2 py-1 rounded-lg text-xs font-medium bg-amber-100 text-amber-800 shadow-sm">
|
||||
مفروش
|
||||
</span>
|
||||
)}
|
||||
{property.purpose === 'rent' && !property.furnished && property.furnished !== undefined && (
|
||||
<span className="px-2 py-1 rounded-lg text-xs font-medium bg-gray-100 text-gray-600 shadow-sm">
|
||||
غير مفروش
|
||||
{property.purpose === 'rent' && property.furnished !== undefined && (
|
||||
<span className={`px-2 py-0.5 rounded-md text-xs font-medium shadow-sm backdrop-blur-sm ${
|
||||
property.furnished ? 'bg-white/90 text-amber-700' : 'bg-white/90 text-gray-600'
|
||||
}`}>
|
||||
{property.furnished ? 'مفروش' : 'غير مفروش'}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="absolute top-2 left-2">
|
||||
<span className="px-2 py-0.5 rounded-md text-xs font-medium bg-white/90 text-amber-700 shadow-sm backdrop-blur-sm">
|
||||
{property.propertyTypeLabel || (property.propertyType === 'apartment' ? 'شقة' : property.propertyType === 'villa' ? 'فيلا' : property.propertyType === 'sweet' ? 'سويت' : property.propertyType === 'room' ? 'غرفة' : property.propertyType === 'studio' ? 'استوديو' : property.propertyType === 'office' ? 'مكتب' : property.propertyType === 'farms' ? 'مزرعة' : property.propertyType === 'shop' ? 'متجر' : property.propertyType === 'warehouse' ? 'مستودع' : 'عقار')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="p-4">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<span className="text-xs px-2 py-0.5 bg-amber-50 text-amber-700 rounded-full">{property.propertyTypeLabel || (property.propertyType === 'apartment' ? 'شقة' : property.propertyType === 'villa' ? 'فيلا' : property.propertyType === 'sweet' ? 'سويت' : property.propertyType === 'room' ? 'غرفة' : property.propertyType === 'studio' ? 'استوديو' : property.propertyType === 'office' ? 'مكتب' : property.propertyType === 'farms' ? 'مزرعة' : property.propertyType === 'shop' ? 'متجر' : property.propertyType === 'warehouse' ? 'مستودع' : 'عقار')}</span>
|
||||
<div className="p-3">
|
||||
<div className="flex items-start justify-between mb-1">
|
||||
<h3 className="font-bold text-gray-900 truncate flex-1 ml-2">{property.title}</h3>
|
||||
{property.rating > 0 && (
|
||||
<div className="flex items-center gap-0.5 text-amber-600 shrink-0">
|
||||
<Star className="w-3 h-3 fill-amber-500" />
|
||||
<span className="text-xs font-medium">{Number(property.rating).toFixed(1)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<h3 className="font-bold text-gray-900 mb-2">{property.title}</h3>
|
||||
|
||||
<div className="flex items-center gap-1 text-gray-500 text-sm mb-3">
|
||||
<MapPin className="w-4 h-4" />
|
||||
{property.address || property.location || 'موقع غير محدد'}
|
||||
<div className="flex items-center gap-1 text-gray-500 text-xs mb-2">
|
||||
<MapPin className="w-3 h-3" />
|
||||
<span className="truncate">{property.address || property.location || 'موقع غير محدد'}</span>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<Bath className="w-4 h-4" />
|
||||
<span>{property.bathrooms}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<Square className="w-4 h-4" />
|
||||
<span>{property.area}م²</span>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2 text-xs text-gray-600 mb-2">
|
||||
{property.bedrooms > 0 && (
|
||||
<div className="flex items-center gap-0.5 bg-gray-50 px-2 py-0.5 rounded-md">
|
||||
<Bed className="w-3 h-3" />
|
||||
<span>{property.bedrooms}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.bathrooms > 0 && (
|
||||
<div className="flex items-center gap-0.5 bg-gray-50 px-2 py-0.5 rounded-md">
|
||||
<Bath className="w-3 h-3" />
|
||||
<span>{property.bathrooms}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.area > 0 && (
|
||||
<div className="flex items-center gap-0.5 bg-gray-50 px-2 py-0.5 rounded-md">
|
||||
<Square className="w-3 h-3" />
|
||||
<span>{property.area}م²</span>
|
||||
</div>
|
||||
)}
|
||||
{property.floor > 0 && (
|
||||
<div className="flex items-center gap-1">
|
||||
<Layers className="w-4 h-4" />
|
||||
<div className="flex items-center gap-0.5 bg-gray-50 px-2 py-0.5 rounded-md">
|
||||
<Layers className="w-3 h-3" />
|
||||
<span>ط {property.floor}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.salons > 0 && (
|
||||
<div className="flex items-center gap-1">
|
||||
<Sofa className="w-4 h-4" />
|
||||
<div className="flex items-center gap-0.5 bg-gray-50 px-2 py-0.5 rounded-md">
|
||||
<Sofa className="w-3 h-3" />
|
||||
<span>{property.salons}</span>
|
||||
</div>
|
||||
)}
|
||||
{property.balconies > 0 && (
|
||||
<div className="flex items-center gap-1">
|
||||
<DoorOpen className="w-4 h-4" />
|
||||
<div className="flex items-center gap-0.5 bg-gray-50 px-2 py-0.5 rounded-md">
|
||||
<DoorOpen className="w-3 h-3" />
|
||||
<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>{Number(property.rating).toFixed(1)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-between items-center pt-3 border-t border-gray-100">
|
||||
<div className="flex justify-between items-center pt-2 border-t border-gray-100">
|
||||
<div>
|
||||
{property.purpose === 'rent' ? (
|
||||
<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>
|
||||
<div>
|
||||
{property.monthlyPrice > 0 && (
|
||||
<span className="text-base font-bold text-amber-600">
|
||||
{Number(property.monthlyPrice).toLocaleString()}
|
||||
<span className="text-xs text-gray-500 font-normal mr-1">ل.س /شهر</span>
|
||||
</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>
|
||||
{property.dailyPrice > 0 && !property.monthlyPrice && (
|
||||
<span className="text-base font-bold text-amber-600">
|
||||
{Number(property.dailyPrice).toLocaleString()}
|
||||
<span className="text-xs text-gray-500 font-normal mr-1">ل.س /يوم</span>
|
||||
</span>
|
||||
)}
|
||||
{property.deposit > 0 && (
|
||||
<span className="text-xs text-gray-400">تأمين: {Number(property.deposit).toLocaleString()}</span>
|
||||
<div className="text-[10px] text-gray-400">تأمين: {Number(property.deposit).toLocaleString()} ل.س</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<span className="text-lg font-bold text-blue-600">
|
||||
{Number(property.salePrice).toLocaleString()} ل.س
|
||||
</span>
|
||||
<span className="text-xs text-gray-500 mr-1">للبيع</span>
|
||||
</div>
|
||||
<span className="text-base font-bold text-blue-600">
|
||||
{Number(property.salePrice).toLocaleString()} ل.س
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
onClick={() => setViewModal({ isOpen: true, property })}
|
||||
className="p-2 hover:bg-blue-50 rounded-lg transition-colors group"
|
||||
title="عرض التفاصيل"
|
||||
>
|
||||
<Eye className="w-4 h-4 text-gray-600 group-hover:text-blue-600" />
|
||||
<div className="flex gap-1">
|
||||
<button onClick={() => setViewModal({ isOpen: true, property })}
|
||||
className="p-1.5 hover:bg-blue-50 rounded-lg transition-colors group" title="عرض التفاصيل">
|
||||
<Eye className="w-3.5 h-3.5 text-gray-400 group-hover:text-blue-600" />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setEditModal({ isOpen: true, property })}
|
||||
className="p-2 hover:bg-amber-50 rounded-lg transition-colors group"
|
||||
title="تعديل العقار"
|
||||
>
|
||||
<Edit className="w-4 h-4 text-gray-600 group-hover:text-amber-600" />
|
||||
<button onClick={() => setEditModal({ isOpen: true, property })}
|
||||
className="p-1.5 hover:bg-amber-50 rounded-lg transition-colors group" title="تعديل العقار">
|
||||
<Edit className="w-3.5 h-3.5 text-gray-400 group-hover:text-amber-600" />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setDeleteModal({ isOpen: true, property })}
|
||||
className="p-2 hover:bg-red-50 rounded-lg transition-colors group"
|
||||
title="حذف العقار"
|
||||
>
|
||||
<Trash2 className="w-4 h-4 text-gray-600 group-hover:text-red-600" />
|
||||
<button onClick={() => setDeleteModal({ isOpen: true, property })}
|
||||
className="p-1.5 hover:bg-red-50 rounded-lg transition-colors group" title="حذف العقار">
|
||||
<Trash2 className="w-3.5 h-3.5 text-gray-400 group-hover:text-red-600" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user