diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 5920293..6667371 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -17,50 +17,12 @@ export default function AdminPage() {
- -
-
-

Logs

-

View recent errors and warnings

-
- New -
-
- - -
-
-

Broadcast

-

Send a message to users

-
- Tools -
-
- - -
-
-

Config

-

Feature flags and settings

-
- Edit -
-
- - -
-
-

Payments

-

Gateways and webhooks

-
- Setup -
-
+ {/* Disabled/hidden cards as requested */}
); diff --git a/components/admin/InvitationsListCard.tsx b/components/admin/InvitationsListCard.tsx index 111b1a3..18172d3 100644 --- a/components/admin/InvitationsListCard.tsx +++ b/components/admin/InvitationsListCard.tsx @@ -16,6 +16,15 @@ export default function InvitationsListCard() { const [loading, setLoading] = useState(true); const [error, setError] = useState(null); + async function deleteInvite(id: string) { + try { + await fetchClient(`/admin/invitations/${id}`, { method: 'DELETE' }); + setInvites(prev => prev.filter(i => i._id !== id)); + } catch (e: any) { + setError(e?.message || 'Failed to delete invitation'); + } + } + useEffect(() => { let mounted = true; (async () => { @@ -47,8 +56,8 @@ export default function InvitationsListCard() { {invites.map((inv) => { const expired = new Date(inv.expiresAt).getTime() < Date.now(); return ( -
-
+
+
Code: {inv.code}
@@ -56,9 +65,19 @@ export default function InvitationsListCard() { Created: {new Date(inv.createdAt).toLocaleString()} · Expires: {new Date(inv.expiresAt).toLocaleString()}
- - {inv.isUsed ? 'Used' : expired ? 'Expired' : 'Active'} - +
+ + {inv.isUsed ? 'Used' : expired ? 'Expired' : 'Active'} + + {!inv.isUsed && ( + + )} +
); })} diff --git a/components/admin/RecentOrdersCard.tsx b/components/admin/RecentOrdersCard.tsx index 9c6fe05..16e61f4 100644 --- a/components/admin/RecentOrdersCard.tsx +++ b/components/admin/RecentOrdersCard.tsx @@ -54,7 +54,7 @@ export default function RecentOrdersCard() {
{new Date(o.createdAt).toLocaleString()}
- User: {o.userId} · Total: {o.total} + User: {o.userId} · Total: £{Number(o.total).toFixed(2)}
{o.items && o.items.length > 0 && (