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,30 @@
'use client'
import type { AttemptResult, Translate } from './types'
import AttemptHistoryItem from './attempt-history-item'
type AttemptHistoryProps = {
attempts: AttemptResult[]
t: Translate
}
export default function AttemptHistory({ attempts, t }: AttemptHistoryProps) {
return (
<div className='mt-6 rounded-xl border border-divider-subtle bg-components-panel-bg p-6 shadow-xs'>
<div className='mb-3 text-sm font-medium uppercase tracking-wide text-text-tertiary'>
{t('challenges.player.attemptHistory', 'Attempts')}
</div>
{attempts.length === 0 ? (
<div className='bg-components-panel-bg/60 rounded-lg border border-divider-subtle p-4 text-sm text-text-secondary'>
{t('challenges.player.noAttempts')}
</div>
) : (
<div className='space-y-4'>
{attempts.map(attempt => (
<AttemptHistoryItem key={attempt.timestamp} attempt={attempt} t={t} />
))}
</div>
)}
</div>
)
}