|
-
- {#if participatedFilterState === 'participated'}
-
-
-
- {:else if participatedFilterState === 'not-participated'}
-
-
-
- {:else}
-
-
-
- {/if}
-
- |
-
-
- {#if typeFilterState === 'icpc'}
-
-
-
-
-
- {:else if typeFilterState === 'codeforces'}
-
-
-
-
- {:else}
-
-
-
- {/if}
- |
- - Contest - | -- Duration - | -
-
- {#if difficultySortDirection === 'asc'}
- ▲
- {:else if difficultySortDirection === 'desc'}
- ▼
- {:else}
-
- ▲
- ▼
-
- {/if}
- Difficulty
-
- |
-
-
-
- |
- - |
|---|---|---|---|---|---|---|
| - {#if contest.id} - {@const hasParticipated = userParticipation.has(contest.id)} - - {/if} - | -
-
- {#if contest.type === 'ICPC'}
- |
- - - {contest.name} - - | -- - {formatDuration(contest.durationSeconds)} - - | -- {#if contest.difficulty !== undefined} - - {getDifficultyStars(contest.difficulty)} - - {:else} - - - {/if} - | -- - @{contest.addedBy} - - | -
-
- {#if contest.id}
- {@const hasLiked = userFeedback[contest.id] === 'like'}
- {@const hasDisliked = userFeedback[contest.id] === 'dislike'}
+// Apply filters to contests
+$: filteredContests = contests.filter((contest) => {
+ // Filter by difficulty
+ if (difficultyFilter !== null && contest.difficulty !== difficultyFilter) {
+ return false;
+ }
-
-
+ // Filter by participation status
+ const stateMap: Record
- |
-