diff --git a/app/components/FloatingSidebar.js b/app/components/FloatingSidebar.js index 1f1a275..3f9698c 100644 --- a/app/components/FloatingSidebar.js +++ b/app/components/FloatingSidebar.js @@ -3,7 +3,7 @@ import { useState } from 'react'; import { motion } from 'framer-motion'; import Link from 'next/link'; -import { Heart, Bell, CreditCard, Shield, UserPlus, Settings, CalendarDays, Star, FileText } from 'lucide-react'; +import { Heart, Bell, CreditCard, Shield, UserPlus, Settings } from 'lucide-react'; import { useFavorites } from '@/app/contexts/FavoritesContext'; import { useNotifications } from '@/app/contexts/NotificationsContext'; import AuthService from '@/app/services/AuthService'; @@ -177,57 +177,6 @@ export default function FloatingSidebar({ isRTL, isAdmin }) { {renderTooltip('payments', 'المدفوعات')} - showTooltip('booked')} - onMouseLeave={hideTooltip} - > - - - - {renderTooltip('booked', 'حجوزاتي')} - - showTooltip('myRates')} - onMouseLeave={hideTooltip} - > - - - - {renderTooltip('myRates', 'تقييماتي')} - - showTooltip('reports')} - onMouseLeave={hideTooltip} - > - - - - {renderTooltip('reports', 'البلاغات')} - - + {property.images && property.images.length > 0 ? ( ) : ( @@ -1089,133 +1089,123 @@ export default function OwnerPropertiesPage() { )} - {property.status === 'available' ? 'متاح' : 'مؤجر'} - {property.purpose === 'rent' && property.furnished && ( - - مفروش - - )} - {property.purpose === 'rent' && !property.furnished && property.furnished !== undefined && ( - - غير مفروش + {property.purpose === 'rent' && property.furnished !== undefined && ( + + {property.furnished ? 'مفروش' : 'غير مفروش'} )} + + + + {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' ? 'مستودع' : 'عقار')} + + - - - {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' ? 'مستودع' : 'عقار')} + + + {property.title} + {property.rating > 0 && ( + + + {Number(property.rating).toFixed(1)} + + )} - {property.title} - - - {property.address || property.location || 'موقع غير محدد'} + + + {property.address || property.location || 'موقع غير محدد'} - - - - {property.bedrooms} - - - - {property.bathrooms} - - - - {property.area}م² - + + {property.bedrooms > 0 && ( + + + {property.bedrooms} + + )} + {property.bathrooms > 0 && ( + + + {property.bathrooms} + + )} + {property.area > 0 && ( + + + {property.area}م² + + )} {property.floor > 0 && ( - - + + ط {property.floor} )} {property.salons > 0 && ( - - + + {property.salons} )} {property.balconies > 0 && ( - - + + {property.balconies} )} - {property.rating > 0 && ( - - - {Number(property.rating).toFixed(1)} - - )} - + {property.purpose === 'rent' ? ( - - {property.rentType === 'monthly' && property.monthlyPrice > 0 && ( - - {Number(property.monthlyPrice).toLocaleString()} - ل.س /شهر + + {property.monthlyPrice > 0 && ( + + {Number(property.monthlyPrice).toLocaleString()} + ل.س /شهر )} - {property.rentType === 'daily' && property.dailyPrice > 0 && ( - - {Number(property.dailyPrice).toLocaleString()} - ل.س /يوم - - )} - {property.rentType === 'daily' && property.monthlyPrice > 0 && ( - - {Number(property.monthlyPrice).toLocaleString()} - ل.س /شهر + {property.dailyPrice > 0 && !property.monthlyPrice && ( + + {Number(property.dailyPrice).toLocaleString()} + ل.س /يوم )} {property.deposit > 0 && ( - تأمين: {Number(property.deposit).toLocaleString()} + تأمين: {Number(property.deposit).toLocaleString()} ل.س )} ) : ( - - - {Number(property.salePrice).toLocaleString()} ل.س - - للبيع - + + {Number(property.salePrice).toLocaleString()} ل.س + )} - - setViewModal({ isOpen: true, property })} - className="p-2 hover:bg-blue-50 rounded-lg transition-colors group" - title="عرض التفاصيل" - > - + + setViewModal({ isOpen: true, property })} + className="p-1.5 hover:bg-blue-50 rounded-lg transition-colors group" title="عرض التفاصيل"> + - setEditModal({ isOpen: true, property })} - className="p-2 hover:bg-amber-50 rounded-lg transition-colors group" - title="تعديل العقار" - > - + setEditModal({ isOpen: true, property })} + className="p-1.5 hover:bg-amber-50 rounded-lg transition-colors group" title="تعديل العقار"> + - setDeleteModal({ isOpen: true, property })} - className="p-2 hover:bg-red-50 rounded-lg transition-colors group" - title="حذف العقار" - > - + setDeleteModal({ isOpen: true, property })} + className="p-1.5 hover:bg-red-50 rounded-lg transition-colors group" title="حذف العقار"> + diff --git a/app/property/[id]/PropertyDetail.js b/app/property/[id]/PropertyDetail.js index 786d4ff..84e6573 100644 --- a/app/property/[id]/PropertyDetail.js +++ b/app/property/[id]/PropertyDetail.js @@ -302,15 +302,15 @@ export default function PropertyDetailsPage() { - - + + {/* Image Gallery */} - + {property.images.length > 0 ? ( + style={{ minHeight: '380px', maxHeight: '460px' }} /> ) : ( @@ -363,29 +363,27 @@ export default function PropertyDetailsPage() { {/* Property Info */} - - + + - - {property.typeLabel} - {property.statusLabel} + + {property.typeLabel} + {property.statusLabel} - {property.title} - - + {property.title} + + {property.location.address || property.location.city} - - - - - + + + {/* Price */} - + {property.isRent ? ( {property.priceDisplay.monthly > 0 && ( @@ -416,79 +414,79 @@ export default function PropertyDetailsPage() { {/* Specs Tiles */} - + {property.bedrooms > 0 && ( - - - {property.bedrooms} - غرف نوم + + + {property.bedrooms} + غرف نوم )} {property.bathrooms > 0 && ( - - - {property.bathrooms} - حمامات + + + {property.bathrooms} + حمامات )} {property.area > 0 && ( - - - {property.area} - م² + + + {property.area} + م² )} {property.floor > 0 && ( - - - {property.floor} - طابق + + + {property.floor} + طابق )} {property.salons > 0 && ( - - - {property.salons} - صالونات + + + {property.salons} + صالونات )} {property.balconies > 0 && ( - - - {property.balconies} - بلكونات + + + {property.balconies} + بلكونات )} {avgRating !== null && avgRating > 0 && ( - - - {avgRating.toFixed(1)} - التقييم + + + {avgRating.toFixed(1)} + التقييم )} {/* Description */} {property.description && ( - - الوصف - {property.description} + + الوصف + {property.description} )} {/* Features */} - - {property.isSmokeAllow && يسمح بالتدخين} - {!property.isSmokeAllow && ممنوع التدخين} - {property.isVisitorAllow && يسمح بالزوار} - {property.specializedFor && {property.specializedFor}} + + {property.isSmokeAllow && يسمح بالتدخين} + {!property.isSmokeAllow && ممنوع التدخين} + {property.isVisitorAllow && يسمح بالزوار} + {property.specializedFor && {property.specializedFor}} {/* Services with detail text */} {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; @@ -505,12 +503,12 @@ export default function PropertyDetailsPage() { {/* Room Details (only for room type) */} {isRoomType && Object.keys(property.roomDetails).length > 0 && ( - - - + + + تفاصيل الغرفة - + {(() => { const rd = property.roomDetails; const items = []; @@ -542,24 +540,24 @@ export default function PropertyDetailsPage() { {/* Proximity */} {Object.keys(property.proximity).length > 0 && ( - - القرب من الخدمات - + + القرب من الخدمات + {Object.entries(property.proximity).map(([key, val]) => { if (!val) return null; const dist = typeof val === 'object' ? val.distance : val; return ( - - {key === 'School' && } - {key === 'Hospital' && } - {key === 'Restaurant' && } - {key === 'University' && } - {key === 'Park' && } - {key === 'Mall' && } - {!['School','Hospital','Restaurant','University','Park','Mall'].includes(key) && } + + {key === 'School' && } + {key === 'Hospital' && } + {key === 'Restaurant' && } + {key === 'University' && } + {key === 'Park' && } + {key === 'Mall' && } + {!['School','Hospital','Restaurant','University','Park','Mall'].includes(key) && } - {proximityLabels[key] || key} - {dist} {typeof dist === 'number' ? 'كم' : ''} + {proximityLabels[key] || key} + {dist} {typeof dist === 'number' ? 'كم' : ''} ); @@ -570,19 +568,19 @@ export default function PropertyDetailsPage() { {/* Terms as checklist */} {Object.keys(property.terms).length > 0 && ( - - الشروط - + + الشروط + {Object.entries(property.terms).map(([key, val]) => { if (!val) return null; return ( - + {key.startsWith('No') || key.startsWith('Only') ? ( - + ) : ( - + )} - {termLabels[key] || key} + {termLabels[key] || key} ); })} @@ -641,45 +639,45 @@ export default function PropertyDetailsPage() { {/* Sidebar */} - + {/* Booking Card */} {property.isRent && ( - - - - حجز العقار + + + + حجز العقار {bookingSuccess ? ( - - - + + + - تم إرسال طلب الحجز - سيتم مراجعة طلبك من قبل المالك + تم إرسال طلب الحجز + سيتم مراجعة طلبك من قبل المالك ) : ( <> - + - من تاريخ + من تاريخ setBookingDates(prev => ({ ...prev, start: e.target.value }))} - className="w-full px-3 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-amber-500" /> + className="w-full px-3 py-1.5 text-sm border border-gray-300 rounded-xl focus:ring-2 focus:ring-amber-500" /> - إلى تاريخ + إلى تاريخ setBookingDates(prev => ({ ...prev, end: e.target.value }))} - className="w-full px-3 py-2 border border-gray-300 rounded-xl focus:ring-2 focus:ring-amber-500" /> + className="w-full px-3 py-1.5 text-sm border border-gray-300 rounded-xl focus:ring-2 focus:ring-amber-500" /> {bookingError && ( - {bookingError} + {bookingError} )} - {bookingLoading ? : } + className="w-full bg-amber-500 hover:bg-amber-600 text-white py-2.5 rounded-xl font-bold text-sm transition-all disabled:opacity-50 flex items-center justify-center gap-2"> + {bookingLoading ? : } {bookingLoading ? 'جاري الحجز...' : 'حجز الآن'} > @@ -688,30 +686,30 @@ export default function PropertyDetailsPage() { )} {/* Contact Card */} - - - - معلومات المالك + + + + معلومات المالك {showContact && contactInfo ? ( - - - - {contactInfo.phone || contactInfo.phoneNumber || '—'} + + + + {contactInfo.phone || contactInfo.phoneNumber || '—'} {contactInfo.whatsAppNumber && ( - - {contactInfo.whatsAppNumber} + className="flex items-center gap-2.5 p-2.5 bg-green-50 rounded-xl hover:bg-green-100 transition-colors"> + + {contactInfo.whatsAppNumber} )} ) : ( - + className="w-full bg-gray-800 hover:bg-gray-900 text-white py-2.5 rounded-xl font-medium text-sm transition-colors flex items-center justify-center gap-2"> + عرض معلومات الاتصال )}
{property.description}
سيتم مراجعة طلبك من قبل المالك