From 14a2f349768c2f1c5a253e96fa278ea37588b01d Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 02:09:08 +0000 Subject: [PATCH] Rewrite Admin dashboard with tabbed layout cgen-b3adf2085f4148f693748703c1e60577 --- client/pages/Admin.tsx | 878 ++++++++++++++++++++++------------------- 1 file changed, 474 insertions(+), 404 deletions(-) diff --git a/client/pages/Admin.tsx b/client/pages/Admin.tsx index 42b27892..661029c1 100644 --- a/client/pages/Admin.tsx +++ b/client/pages/Admin.tsx @@ -111,17 +111,16 @@ export default function Admin() {
- + - Access Denied + Access denied - You don't have permission to access the admin panel. + This panel is restricted to {ownerEmail}. If you need access, contact the site owner. - - + + +
@@ -287,447 +286,518 @@ export default function Admin() {
-
-
-

Admin Panel

+
+
+

Admin Control Center

- Site Owner • Admin • Founder + Unified oversight for AeThex operations, content, and community.

-
- - Site Owner +
+ + Owner - + Admin - + Founder
+

+ Signed in as {normalizedEmail || ownerEmail} +

-
+
+
-
- - -
- - Access Control -
- - Owner-only access is enforced by email - -
- -
    -
  • - Owner:{" "} - mrpiglr@gmail.com -
  • -
  • All other users are denied access
  • -
-
-
+ + + Overview + Content + Community + Operations + - - -
- - Users & Roles -
- - Future: manage roles, invitations, and status - -
- -

Coming soon

-
-
+ +
+ {overviewStats.map((stat) => ( + + ))} +
- {/* Blog Posts Management */} - - -
- - Blog Posts -
- - Manage blog content stored in Supabase - -
- -
- + ))} + + + + + +
+ + Access control +
+ Owner-only access enforced via Supabase roles. +
+ +
    +
  • + Owner email: {ownerEmail} +
  • +
  • Roles are provisioned automatically on owner sign-in.
  • +
  • Grant additional admins by updating Supabase role assignments.
  • +
+
+ + +
+
+
+
+
+ + + + +
+ + Content overview +
+ + {publishedPosts} published {publishedPosts === 1 ? "post" : "posts"} · {loadingPosts ? "refreshing content…" : "latest Supabase sync"} + +
+ +

+ Drafts and announcements appear instantly on the public blog after saving. Use scheduled releases for major updates and keep thumbnails optimised for 1200×630. +

+
+
+ + + +
+ + Blog posts +
+ Manage blog content stored in Supabase +
+ +
+ + - -
+ > + Add post + +
- {blogPosts.map((p, i) => ( -
-
- + No posts loaded yet. Use “Refresh” or “Add post” to start managing content. +

+ )} + + {blogPosts.map((p, i) => ( +
+
+ { + const next = blogPosts.slice(); + next[i] = { ...next[i], title: e.target.value }; + setBlogPosts(next); + }} + /> + { + const next = blogPosts.slice(); + next[i] = { ...next[i], slug: e.target.value }; + setBlogPosts(next); + }} + /> +
+
+ { + const n = blogPosts.slice(); + n[i] = { ...n[i], author: e.target.value }; + setBlogPosts(n); + }} + /> + { + const n = blogPosts.slice(); + n[i] = { ...n[i], date: e.target.value }; + setBlogPosts(n); + }} + /> +
+
+ { + const n = blogPosts.slice(); + n[i] = { ...n[i], read_time: e.target.value }; + setBlogPosts(n); + }} + /> + { + const n = blogPosts.slice(); + n[i] = { ...n[i], category: e.target.value }; + setBlogPosts(n); + }} + /> + { + const n = blogPosts.slice(); + n[i] = { ...n[i], image: e.target.value }; + setBlogPosts(n); + }} + /> +
+