Skip to content

Commit

Permalink
Add no submissions msg to all submissions tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Pabl0cks committed Sep 17, 2024
1 parent 83f220c commit a7867a2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/nextjs/app/admin/_components/SubmissionTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,19 @@ export const SubmissionTabs = ({ submissions }: { submissions: Submission[] }) =
</div>
</div>

{/* New All Submissions Tab */}
{/* All Submissions Tab */}
<input type="radio" name="submission_tabs" role="tab" className="tab whitespace-nowrap" aria-label={allLabel} />
<div role="tabpanel" className="tab-content py-6">
<div className="grid gap-6 md:grid-cols-2 xl:grid-cols-3">
{all
.sort((a, b) => b.avgScore - a.avgScore)
.map(submission => (
<SubmissionCard key={submission.id} submission={submission} tabName="all" />
))}
{all.length === 0 ? (
<div role="alert" className="alert col-span-2">
<span>There are no submissions yet.</span>
</div>
) : (
all
.sort((a, b) => b.avgScore - a.avgScore)
.map(submission => <SubmissionCard key={submission.id} submission={submission} tabName="all" />)
)}
</div>
</div>
</div>
Expand Down

0 comments on commit a7867a2

Please sign in to comment.