diff --git a/app/dashboard/company/[slug]/hackathons/page.tsx b/app/dashboard/company/[slug]/hackathons/page.tsx index 6b029595..1b985cc0 100644 --- a/app/dashboard/company/[slug]/hackathons/page.tsx +++ b/app/dashboard/company/[slug]/hackathons/page.tsx @@ -130,40 +130,42 @@ export default function CompanyHackathonsPage() { approved: hackathons.filter(h => h.approval_status === 'approved').length, pending: hackathons.filter(h => h.approval_status === 'pending').length, draft: hackathons.filter(h => h.status === 'draft').length, + totalViews: hackathons.reduce((sum, h) => sum + (h.views || 0), 0), + totalRegistrations: hackathons.reduce((sum, h) => sum + (h.registered || 0), 0), } const getApprovalBadge = (status: string) => { switch (status) { case 'approved': return ( - + Approved ) case 'pending': return ( - + Pending ) case 'rejected': return ( - + Rejected ) case 'changes_requested': return ( - + Changes Requested ) default: - return {status} + return {status} } } @@ -172,15 +174,15 @@ export default function CompanyHackathonsPage() { if (hackathon.approval_status !== 'approved') { switch (hackathon.approval_status) { case 'pending': - return Pending Review + return Pending Review case 'draft': - return Draft + return Draft case 'rejected': - return Rejected + return Rejected case 'changes_requested': - return Changes Requested + return Changes Requested default: - return {hackathon.approval_status} + return {hackathon.approval_status} } } @@ -188,15 +190,15 @@ export default function CompanyHackathonsPage() { switch (hackathon.status) { case 'live': case 'published': - return Live + return Live case 'draft': - return Draft + return Draft case 'cancelled': - return Cancelled + return Cancelled case 'completed': - return Completed + return Completed default: - return {hackathon.status} + return {hackathon.status} } } @@ -229,7 +231,7 @@ export default function CompanyHackathonsPage() { {/* Stats Cards */} -
+
Total Hackathons @@ -266,6 +268,24 @@ export default function CompanyHackathonsPage() {
{stats.draft}
+ + + Total Views + + + +
{stats.totalViews}
+
+
+ + + Total Registrations + + + +
{stats.totalRegistrations}
+
+
{/* Search */} @@ -346,7 +366,18 @@ export default function CompanyHackathonsPage() { {hackathon.views || 0}
- {hackathon.registered || 0} + + {hackathon.registered && hackathon.registered > 0 ? ( + + {hackathon.registered} + + ) : ( + 0 + )} + {canManageEvents ? (