@@ -23,7 +23,9 @@ import { UserProfileCard } from '@/components/shared/user-profile-card';
2323import { getInitials } from '@/lib/utils' ;
2424import EchartsTrendChart from '@/components/charts/echarts-trend-chart' ;
2525import { AnnouncementsCard } from '@/components/contests/announcements-card' ;
26- import { UserScoreCard } from '@/components/contests/user-score-card' ;
26+ import { DifficultyBadge } from '@/components/contests/difficulty-badge' ;
27+ import UserScoreCard from '@/components/contests/user-score-card' ;
28+ import { Search , List } from 'lucide-react' ;
2729
2830const fetcher = ( url : string ) => api . get ( url ) . then ( res => res . data . data ) ;
2931
@@ -254,10 +256,10 @@ function ProblemCard({ problemId, index }: { problemId: string; index: number })
254256 const t = useTranslations ( 'contests' ) ;
255257 const { data : problem , isLoading } = useSWR < Problem > ( `/problems/${ problemId } ` , fetcher ) ;
256258
257- if ( isLoading ) return < Skeleton className = "h-24 w-full" /> ;
259+ if ( isLoading ) return < Skeleton className = "h-28 w-full" /> ;
258260
259261 return (
260- < Link href = { `/problems?id=${ problemId } ` } className = "relative block overflow-hidden hover:shadow-lg transition-shadow duration-300" >
262+ < Link href = { `/problems?id=${ problemId } ` } className = "relative block overflow-hidden rounded-lg hover:shadow-lg transition-shadow duration-300" >
261263 < Card className = "h-full" >
262264 < div className = "relative z-10" >
263265 < CardHeader className = "flex flex-row items-center justify-between space-y-0 pb-2" >
@@ -266,6 +268,7 @@ function ProblemCard({ problemId, index }: { problemId: string; index: number })
266268 </ CardHeader >
267269 < CardContent >
268270 < div className = "text-xs text-muted-foreground mb-4" > { t ( 'problemCard.id' ) } : { problemId } </ div >
271+ < DifficultyBadge level = { problem ?. level || "" } />
269272 </ CardContent >
270273 </ div >
271274
@@ -275,7 +278,7 @@ function ProblemCard({ problemId, index }: { problemId: string; index: number })
275278 absolute bottom-0 right-0 z-0
276279 transform translate-x-1/5 translate-y-1/4
277280 text-9xl font-extrabold
278- text-neutral-500/10 dark:text-white/5
281+ text-gray-100 dark:text-zinc-700
279282 pointer-events-none select-none
280283 "
281284 >
@@ -289,34 +292,52 @@ function ProblemCard({ problemId, index }: { problemId: string; index: number })
289292function ContestProblems ( { contestId } : { contestId : string } ) {
290293 const t = useTranslations ( 'contests' ) ;
291294 const { data : contest , error, isLoading } = useSWR < Contest > ( `/contests/${ contestId } ` , fetcher ) ;
295+
292296 if ( isLoading ) return < Skeleton className = "h-64 w-full" /> ;
293297 if ( error ) return < div > { t ( 'detail.loadFail' ) } </ div > ;
294298 if ( ! contest ) return < div > { t ( 'detail.notFound' ) } </ div > ;
299+
295300 return (
296301 < div className = "space-y-6" >
297302 < Card >
298- < CardHeader > < CardTitle > { t ( 'description.title' ) } </ CardTitle > </ CardHeader >
303+ < CardHeader >
304+ < div className = "flex items-center space-x-2" >
305+ < Search className = "w-5 h-5" />
306+ < CardTitle className = "font-bold" > { t ( 'description.title' ) } </ CardTitle >
307+ </ div >
308+ </ CardHeader >
299309 < CardContent >
300- < MarkdownViewer
301- content = { contest . description }
310+ < MarkdownViewer
311+ content = { contest . description }
302312 assetContext = "contest"
303313 assetContextId = { contest . id }
304314 />
305315 </ CardContent >
306316 </ Card >
317+
307318 < Card >
308319 < CardHeader >
309- < CardTitle > { t ( 'problems.title' ) } </ CardTitle >
310- < CardDescription > { contest . problem_ids . length > 0 ? t ( 'problems.instruction' ) : t ( 'problems.none' ) } </ CardDescription >
320+ < div className = "flex items-center space-x-2" >
321+ < List className = "w-5 h-5" />
322+ < CardTitle className = "font-bold" > { t ( 'problems.title' ) } </ CardTitle >
323+ </ div >
324+ < CardDescription >
325+ { contest . problem_ids . length > 0
326+ ? t ( 'problems.instruction' )
327+ : t ( 'problems.none' ) }
328+ </ CardDescription >
311329 </ CardHeader >
312330 < CardContent className = "grid gap-4 md:grid-cols-2 lg:grid-cols-3" >
313- { contest . problem_ids . map ( ( problemId , i ) => < ProblemCard key = { problemId } problemId = { problemId } index = { i + 1 } /> ) }
331+ { contest . problem_ids . map ( ( problemId , i ) => (
332+ < ProblemCard key = { problemId } problemId = { problemId } index = { i + 1 } />
333+ ) ) }
314334 </ CardContent >
315335 </ Card >
316336 </ div >
317337 ) ;
318338}
319339
340+
320341function ContestTrend ( { contest } : { contest : Contest } ) {
321342 const t = useTranslations ( 'contests' ) ;
322343 const { data : trendData , error, isLoading } = useSWR < TrendEntry [ ] > ( `/contests/${ contest . id } /trend` , fetcher , { refreshInterval : 30000 } ) ;
@@ -536,8 +557,8 @@ function ContestDetailView({ contestId, view }: { contestId: string, view: strin
536557 </ div >
537558
538559 < div className = "space-y-6 lg:sticky lg:top-20" >
539- < AnnouncementsCard contestId = { contestId } />
540560 < UserScoreCard contestId = { contestId } />
561+ < AnnouncementsCard contestId = { contestId } />
541562 </ div >
542563 </ div >
543564 </ div >
0 commit comments