diff --git a/artifacts/teaboy-os/src/locales/ar.json b/artifacts/teaboy-os/src/locales/ar.json index 53c2797f..f514286e 100644 --- a/artifacts/teaboy-os/src/locales/ar.json +++ b/artifacts/teaboy-os/src/locales/ar.json @@ -96,7 +96,16 @@ "siteNameAr": "اسم الموقع (عربي)", "siteNameEn": "اسم الموقع (إنجليزي)", "registrationOpen": "السماح بإنشاء حسابات", - "registrationOpenHint": "عند الإيقاف، الأدمن فقط يقدر ينشئ مستخدمين جدد." + "registrationOpenHint": "عند الإيقاف، الأدمن فقط يقدر ينشئ مستخدمين جدد.", + "nav": { + "dashboard": "الرئيسية", + "apps": "التطبيقات", + "services": "الخدمات", + "users": "المستخدمين", + "settings": "الإعدادات", + "menu": "القائمة" + }, + "dashboardSoon": "إحصائيات اللوحة قريباً." }, "notFound": { "title": "404 — الصفحة غير موجودة", diff --git a/artifacts/teaboy-os/src/locales/en.json b/artifacts/teaboy-os/src/locales/en.json index 952fc4c6..2c0b5788 100644 --- a/artifacts/teaboy-os/src/locales/en.json +++ b/artifacts/teaboy-os/src/locales/en.json @@ -96,7 +96,16 @@ "siteNameAr": "Site Name (Arabic)", "siteNameEn": "Site Name (English)", "registrationOpen": "Allow public registration", - "registrationOpenHint": "When off, only admins can create new users." + "registrationOpenHint": "When off, only admins can create new users.", + "nav": { + "dashboard": "Dashboard", + "apps": "Apps", + "services": "Services", + "users": "Users", + "settings": "Settings", + "menu": "Menu" + }, + "dashboardSoon": "Dashboard widgets coming soon." }, "notFound": { "title": "404 — Page Not Found", diff --git a/artifacts/teaboy-os/src/pages/admin.tsx b/artifacts/teaboy-os/src/pages/admin.tsx index 8ab39685..675fd5bd 100644 --- a/artifacts/teaboy-os/src/pages/admin.tsx +++ b/artifacts/teaboy-os/src/pages/admin.tsx @@ -24,13 +24,16 @@ import { import { useQueryClient } from "@tanstack/react-query"; import { useAuth } from "@/contexts/AuthContext"; import { useUpload, type UploadResponse } from "@workspace/object-storage-web"; -import { ArrowRight, ArrowLeft, Settings, Plus, Pencil, Trash2, Shield, Upload, Loader2 } from "lucide-react"; +import { ArrowRight, ArrowLeft, Settings, Plus, Pencil, Trash2, Shield, Upload, Loader2, LayoutDashboard, Grid2X2, Coffee, Users as UsersIcon, Menu as MenuIcon } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; import { useToast } from "@/hooks/use-toast"; +import { cn } from "@/lib/utils"; + +type AdminSection = "dashboard" | "apps" | "services" | "users" | "settings"; type AppForm = { nameAr: string; @@ -87,6 +90,42 @@ export default function AdminPage() { const [editingApp, setEditingApp] = useState<{ id?: number; form: AppForm } | null>(null); const [editingService, setEditingService] = useState<{ id?: number; form: ServiceForm } | null>(null); const [newUserForm, setNewUserForm] = useState<{ username: string; email: string; password: string } | null>(null); + const [section, setSection] = useState("dashboard"); + const [mobileNavOpen, setMobileNavOpen] = useState(false); + + const navItems: { key: AdminSection; label: string; Icon: typeof LayoutDashboard }[] = [ + { key: "dashboard", label: t("admin.nav.dashboard"), Icon: LayoutDashboard }, + { key: "apps", label: t("admin.nav.apps"), Icon: Grid2X2 }, + { key: "services", label: t("admin.nav.services"), Icon: Coffee }, + { key: "users", label: t("admin.nav.users"), Icon: UsersIcon }, + { key: "settings", label: t("admin.nav.settings"), Icon: Settings }, + ]; + + const renderNavList = (onSelect?: () => void) => ( + + ); const emptyAppForm: AppForm = { nameAr: "", nameEn: "", slug: "", iconName: "Grid2X2", route: "/", color: "#6366f1", sortOrder: 0 }; const emptyServiceForm: ServiceForm = { nameAr: "", nameEn: "", descriptionAr: "", descriptionEn: "", price: "0.00", imageUrl: "", isAvailable: true }; @@ -171,10 +210,27 @@ export default function AdminPage() { > -
- -

{t("admin.title")}

+
+ +

{t("admin.title")}

+ + + + + +
+ +

{t("admin.title")}

+
+ {renderNavList(() => setMobileNavOpen(false))} +
+
{/* Edit App Modal */} @@ -303,17 +359,24 @@ export default function AdminPage() { )} -
- - - {t("admin.manageApps")} - {t("admin.manageServices")} - {t("admin.manageUsers")} - {t("admin.siteSettings")} - +
+ {/* Sidebar (desktop) */} + - {/* Apps Tab */} - + {/* Main content */} +
+ {section === "dashboard" && ( +
+ {t("admin.dashboardSoon")} +
+ )} + + {section === "apps" && ( +
))} - +
+ )} - {/* Services Tab */} - + {section === "services" && ( +
))} -
+
+ )} - {/* Users Tab */} - + {section === "users" && ( +
))} -
+
+ )} - - - - + {section === "settings" && ( +
+ +
+ )} + );