Delete admin
Some checks failed
Build frontend / build (push) Failing after 1m20s

This commit is contained in:
Rahaf
2026-06-10 19:50:49 +03:00
parent 34da1314d4
commit 71b1a71904
21 changed files with 128 additions and 4940 deletions

View File

@ -25,7 +25,6 @@ import {
Mail,
MapPin,
Camera,
Shield,
Bell,
Home,
ChevronDown,
@ -34,7 +33,6 @@ import {
TrendingUp,
CalendarDays,
Clock,
Users,
DollarSign,
Star,
FileText,
@ -80,9 +78,7 @@ export default function ClientLayout({ children }) {
name: authUser.name || authUser.email,
email: authUser.email,
phone: authUser.phone,
role: AuthService.isAdmin() ? UserRole.ADMIN
: AuthService.isOwner() ? UserRole.OWNER
: UserRole.CUSTOMER,
role: AuthService.isOwner() ? UserRole.OWNER : UserRole.CUSTOMER,
});
} else {
setUser(null);
@ -138,7 +134,6 @@ export default function ClientLayout({ children }) {
const isProfilePage = pathname === "/profile";
const isOwner = user?.role === UserRole.OWNER;
const isAdmin = user?.role === UserRole.ADMIN;
const isCustomer = user?.role === UserRole.CUSTOMER;
const isAuthenticated = !!user;
@ -234,14 +229,6 @@ export default function ClientLayout({ children }) {
<NavLink href="/">الرئيسية</NavLink>
<NavLink href="/properties">عقاراتنا</NavLink>
{isAdmin && (
<NavLink href="/admin">
<span className="flex items-center gap-2">
<Shield className="w-4 h-4" />
الإدارة
</span>
</NavLink>
)}
{isOwner && (
<>
@ -500,82 +487,6 @@ export default function ClientLayout({ children }) {
</>
)}
{isAdmin && (
<>
<div className="border-t border-gray-100 my-2"></div>
<Link
href="/admin"
className="flex items-center gap-3 px-4 py-3 text-gray-700 hover:bg-amber-50 rounded-lg transition-colors"
onClick={() => setShowUserMenu(false)}
>
<Shield className="w-5 h-5 text-amber-500" />
<div>
<p className="font-medium">لوحة التحكم</p>
<p className="text-xs text-gray-500">
إدارة المنصة
</p>
</div>
</Link>
<Link
href="/admin/users"
className="flex items-center gap-3 px-4 py-3 text-gray-700 hover:bg-amber-50 rounded-lg transition-colors"
onClick={() => setShowUserMenu(false)}
>
<Users className="w-5 h-5 text-amber-500" />
<div>
<p className="font-medium">المستخدمين</p>
<p className="text-xs text-gray-500">
إدارة المستخدمين
</p>
</div>
</Link>
<Link
href="/admin/properties"
className="flex items-center gap-3 px-4 py-3 text-gray-700 hover:bg-amber-50 rounded-lg transition-colors"
onClick={() => setShowUserMenu(false)}
>
<Building className="w-5 h-5 text-amber-500" />
<div>
<p className="font-medium">العقارات</p>
<p className="text-xs text-gray-500">
إدارة جميع العقارات
</p>
</div>
</Link>
<Link
href="/admin/bookings"
className="flex items-center gap-3 px-4 py-3 text-gray-700 hover:bg-amber-50 rounded-lg transition-colors"
onClick={() => setShowUserMenu(false)}
>
<Calendar className="w-5 h-5 text-amber-500" />
<div>
<p className="font-medium">الحجوزات</p>
<p className="text-xs text-gray-500">
إدارة الحجوزات
</p>
</div>
</Link>
<Link
href="/admin/ledger"
className="flex items-center gap-3 px-4 py-3 text-gray-700 hover:bg-amber-50 rounded-lg transition-colors"
onClick={() => setShowUserMenu(false)}
>
<DollarSign className="w-5 h-5 text-amber-500" />
<div>
<p className="font-medium">دفتر الحسابات</p>
<p className="text-xs text-gray-500">
إدارة المعاملات المالية
</p>
</div>
</Link>
</>
)}
{isCustomer && (
<>
<div className="border-t border-gray-100 my-2"></div>
@ -730,15 +641,6 @@ export default function ClientLayout({ children }) {
</div>
<div className="border-t border-gray-200 my-2"></div>
{isAdmin && (
<MobileNavLink href="/admin" onClick={closeMobileMenu}>
<span className="flex items-center gap-2">
<Shield className="w-4 h-4" />
الإدارة
</span>
</MobileNavLink>
)}
{isOwner && (
<>
<MobileNavLink
@ -871,16 +773,6 @@ export default function ClientLayout({ children }) {
{t("ourProducts")}
</Link>
</li>
{isAdmin && (
<li>
<Link
href="/admin"
className="text-gray-400 hover:text-white transition-colors block py-1"
>
الإدارة
</Link>
</li>
)}
</ul>
</div>
<div>