You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build the complete admin dashboard page from scratch where admins can view pending artwork and moderate it. Currently /app/admin/page.tsx doesn't exist.
Tasks
Create /app/admin/page.tsx:
This file doesn't exist - create it from scratch!
Add server-side auth check at top of component
If not admin, redirect to home
Design Pending Queue Interface:
Grid or list view of pending artworks
Each card shows: thumbnail (small image preview), title, artist name, submission date
Loading state while fetching data
Empty state: "No pending artwork to review"
Add Action Buttons for Each Artwork:
✅ Approve (green button)
❌ Reject (red button)
⭐ Feature (yellow/gold button)
👤 Reassign (blue button)
Create Modals:
Reject Modal: Text input for rejection reason + confirm/cancel buttons
Reassign Modal: Dropdown to select user + confirm/cancel
Feature Modal: "Feature this artwork?" confirmation
Implement Logic:
'use client';import{useEffect,useState}from'react';exportdefaultfunctionAdminDashboard(){const[artworks,setArtworks]=useState([]);const[loading,setLoading]=useState(true);useEffect(()=>{fetchQueue();},[]);constfetchQueue=async()=>{constres=awaitfetch('/api/admin/queue');constdata=awaitres.json();setArtworks(data.artworks);setLoading(false);};consthandleApprove=async(id: string)=>{awaitfetch(`/api/admin/artworks/${id}/approve`,{method: 'PATCH'});fetchQueue();// Refresh};consthandleReject=async(id: string,reason: string)=>{awaitfetch(`/api/admin/artworks/${id}/reject`,{method: 'PATCH',body: JSON.stringify({ reason })});fetchQueue();};// Similar for feature and reassign...}
Styling:
Use AFH brand colors (orange #F26729, blue #1B264F)
Consistent spacing and typography
Hover effects on buttons
Responsive grid layout
Test Full Workflow:
Login as admin
View pending queue
Click each button and verify modals open
Submit actions and verify artwork disappears from queue
Acceptance Criteria
✅ Admin dashboard page exists at /admin
✅ Fetches pending artworks on load
✅ All 4 action buttons work and call correct endpoints
Objective
Build the complete admin dashboard page from scratch where admins can view pending artwork and moderate it. Currently
/app/admin/page.tsxdoesn't exist.Tasks
Create
/app/admin/page.tsx:Design Pending Queue Interface:
Add Action Buttons for Each Artwork:
Create Modals:
Implement Logic:
Styling:
Test Full Workflow:
Acceptance Criteria
/admin