diff --git a/app/ClientLayout.js b/app/ClientLayout.js
index 1a3645c..00775ea 100644
--- a/app/ClientLayout.js
+++ b/app/ClientLayout.js
@@ -709,9 +709,9 @@ export default function ClientLayout({ children }) {
className={`${!isAuthPage && !isProfilePage ? "pt-20" : ""} min-h-screen bg-gradient-to-b from-gray-50 to-white ${currentLanguage === "ar" ? "text-right" : "text-left"}`}
>
- {children}
- {!isAdmin && }
-
+ {children}
+
+
{!isAuthPage && !isProfilePage && (
diff --git a/app/admin/add-admin/page.js b/app/admin/add-admin/page.js
new file mode 100644
index 0000000..bad4889
--- /dev/null
+++ b/app/admin/add-admin/page.js
@@ -0,0 +1,123 @@
+'use client';
+
+import { useEffect, useState } from 'react';
+import AuthService from '@/app/services/AuthService';
+import Link from 'next/link';
+
+export default function AddAdminPage() {
+ const [isAdmin, setIsAdmin] = useState(false);
+ const [checked, setChecked] = useState(false);
+ const [formState, setFormState] = useState({ fullName: '', email: '', password: '' });
+ const [saved, setSaved] = useState(false);
+
+ useEffect(() => {
+ setIsAdmin(AuthService.isAuthenticated() && AuthService.isAdmin());
+ setChecked(true);
+ }, []);
+
+ const handleChange = (field) => (event) => {
+ setFormState((prev) => ({ ...prev, [field]: event.target.value }));
+ };
+
+ const handleSubmit = (event) => {
+ event.preventDefault();
+ setSaved(true);
+ console.log('Add admin payload', formState);
+ };
+
+ if (!checked) {
+ return (
+
+ );
+ }
+
+ if (!isAdmin) {
+ return (
+
+
+
+ العودة للرئيسية
+
+
+
+ );
+ }
+
+ return (
+
+
+
+
+
لوحة المدير
+
إضافة مدير جديد
+
انشئ حساب مسؤول جديد مع صلاحيات الإدارة.
+
+
+
رابط سريع
+
تعديل سياسة الخصوصية
+
+
+
+
+
+ بيانات المدير
+
+ {saved && (
+
+ تم حفظ بيانات المدير بنجاح
+
+ )}
+
+
+
+
+
+
+ );
+}
diff --git a/app/admin/privacy/page.js b/app/admin/privacy/page.js
new file mode 100644
index 0000000..963acf9
--- /dev/null
+++ b/app/admin/privacy/page.js
@@ -0,0 +1,88 @@
+'use client';
+
+import { useEffect, useState } from 'react';
+import AuthService from '@/app/services/AuthService';
+import Link from 'next/link';
+
+const initialPolicy = `1. نحترم خصوصيتك ونلتزم بحماية بياناتك الشخصية.
+2. يتم استخدام المعلومات لتحسين تجربة المستخدم وتأمين الخدمة.
+3. لا نشارك البيانات مع أطراف خارجية بدون موافقتك.
+4. يمكنك طلب حذف بياناتك من النظام في أي وقت.`;
+
+export default function PrivacyPolicyAdminPage() {
+ const [isAdmin, setIsAdmin] = useState(false);
+ const [checked, setChecked] = useState(false);
+ const [policyText, setPolicyText] = useState(initialPolicy);
+ const [saved, setSaved] = useState(false);
+
+ useEffect(() => {
+ setIsAdmin(AuthService.isAuthenticated() && AuthService.isAdmin());
+ setChecked(true);
+ }, []);
+
+ const handleSave = (event) => {
+ event.preventDefault();
+ setSaved(true);
+ console.log('Privacy policy updated:', policyText);
+ };
+
+ if (!checked) {
+ return (
+
+ );
+ }
+
+ if (!isAdmin) {
+ return (
+
+
+
هذه الصفحة لتحرير سياسة الخصوصية ولا يمكن الوصول إليها إلا للمدير.
+
+ العودة للرئيسية
+
+
+
+ );
+ }
+ return (
+
+
+
+
+
+
لوحة المدير
+
قم بتحديث نص سياسة الخصوصية
+
+
+ إضافة أدمن جديد
+
+
+
+
+
+
+
+ );
+}
diff --git a/app/components/FloatingSidebar.js b/app/components/FloatingSidebar.js
index 2f4082f..66b4fd3 100644
--- a/app/components/FloatingSidebar.js
+++ b/app/components/FloatingSidebar.js
@@ -3,10 +3,10 @@
import { useState } from 'react';
import { motion } from 'framer-motion';
import Link from 'next/link';
-import { Heart, Bell, CreditCard } from 'lucide-react';
+import { Heart, Bell, CreditCard, Shield, UserPlus } from 'lucide-react';
import { useFavorites } from '@/app/contexts/FavoritesContext';
-export default function FloatingSidebar({ isRTL }) {
+export default function FloatingSidebar({ isRTL, isAdmin }) {
const { favorites } = useFavorites();
const [tooltip, setTooltip] = useState(null);
let timeoutId = null;
@@ -40,6 +40,24 @@ export default function FloatingSidebar({ isRTL }) {
tap: { scale: 0.95 },
};
+ const renderTooltip = (id, label) => {
+ if (tooltip !== id) return null;
+ return (
+
+
+ {label}
+
+
+
+ );
+ };
+
return (
-
-
showTooltip('favorites')}
- onMouseLeave={hideTooltip}
- >
-
-
-
- {favorites.length > 0 && (
-
- {favorites.length}
-
- )}
-
-
- {tooltip === 'favorites' && (
-
+ {isAdmin ? (
+ <>
+ showTooltip('addAdmin')}
+ onMouseLeave={hideTooltip}
>
-
- المفضلة
-
-
-
- )}
-
-
showTooltip('notifications')}
- onMouseLeave={hideTooltip}
- >
-
-
-
-
- 3
-
-
-
- {tooltip === 'notifications' && (
-
+
+ {renderTooltip('addAdmin', 'إضافة أدمن')}
+
+
+
showTooltip('editPrivacy')}
+ onMouseLeave={hideTooltip}
>
-
- الإشعارات
-
-
-
- )}
-
- showTooltip('payments')}
- onMouseLeave={hideTooltip}
- >
-
-
-
- {tooltip === 'payments' && (
-
+
+
+ {renderTooltip('editPrivacy', 'تعديل سياسة الخصوصية')}
+
+ >
+ ) : (
+ <>
+ showTooltip('favorites')}
+ onMouseLeave={hideTooltip}
>
-
- المدفوعات
-
-
-
- )}
-
+
+
+
+ {favorites.length > 0 && (
+
+ {favorites.length}
+
+ )}
+
+
+ {renderTooltip('favorites', 'المفضلة')}
+
+ showTooltip('notifications')}
+ onMouseLeave={hideTooltip}
+ >
+
+
+
+
+ 3
+
+
+
+ {renderTooltip('notifications', 'الإشعارات')}
+
+ showTooltip('payments')}
+ onMouseLeave={hideTooltip}
+ >
+
+
+
+ {renderTooltip('payments', 'المدفوعات')}
+
+ >
+ )}
);