Separate into components

This commit is contained in:
Joey Yakimowich-Payne 2025-10-13 11:40:17 -06:00
commit d97ffc9837
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
13 changed files with 441 additions and 143 deletions

View file

@ -0,0 +1,21 @@
'use client'
import Leaderboard from '@/app/components/challenge/leaderboard'
import type { LeaderboardEntry } from './types'
type LeaderboardSectionProps = {
leaderboard: LeaderboardEntry[]
scoringStrategy?: string
emptyHint: string
}
export default function LeaderboardSection({ leaderboard, scoringStrategy, emptyHint }: LeaderboardSectionProps) {
if (leaderboard.length > 0)
return <Leaderboard entries={leaderboard} strategy={scoringStrategy} />
return (
<div className='rounded-xl border border-divider-subtle bg-components-panel-bg p-6 text-sm text-text-secondary shadow-xs'>
{emptyHint}
</div>
)
}