|
10 | 10 | TableHeadCell, |
11 | 11 | } from 'svelte-5-ui-lib'; |
12 | 12 |
|
13 | | - import { type TaskResult, type TaskResults, TaskGrade } from '$lib/types/task'; |
| 13 | + import { type TaskResult, type TaskResults } from '$lib/types/task'; |
14 | 14 |
|
| 15 | + import GradeLabel from '$lib/components/GradeLabel.svelte'; |
15 | 16 | import ThermometerProgressBar from '$lib/components/ThermometerProgressBar.svelte'; |
16 | 17 | import UpdatingModal from '$lib/components/SubmissionStatus/UpdatingModal.svelte'; |
17 | 18 | import SubmissionStatusImage from '$lib/components/SubmissionStatus/SubmissionStatusImage.svelte'; |
|
21 | 22 | import { getBackgroundColorFrom } from '$lib/services/submission_status'; |
22 | 23 |
|
23 | 24 | import { addContestNameToTaskIndex } from '$lib/utils/contest'; |
24 | | - import { toWhiteTextIfNeeds, getTaskUrl, removeTaskIndexFromTitle } from '$lib/utils/task'; |
| 25 | + import { getTaskUrl, removeTaskIndexFromTitle } from '$lib/utils/task'; |
25 | 26 |
|
26 | 27 | interface Props { |
27 | 28 | grade: string; |
28 | | - gradeColor: string; |
29 | 29 | taskResults: TaskResults; |
30 | 30 | isAdmin: boolean; |
31 | 31 | isLoggedIn: boolean; |
32 | 32 | } |
33 | 33 |
|
34 | | - let { grade, gradeColor, taskResults, isAdmin, isLoggedIn }: Props = $props(); |
| 34 | + let { grade, taskResults, isAdmin, isLoggedIn }: Props = $props(); |
35 | 35 |
|
36 | 36 | // TODO: 他のコンポーネントでも利用できるようにする。 |
37 | 37 | let updatingModal: UpdatingModal | null = null; |
|
49 | 49 | <AccordionItem> |
50 | 50 | {#snippet header()} |
51 | 51 | <span class="flex justify-around w-full place-items-center"> |
52 | | - <div |
53 | | - class="text-sm xs:text-xl w-9 xs:w-12 p-0.5 text-center rounded-lg {toWhiteTextIfNeeds( |
54 | | - grade, |
55 | | - )} {gradeColor}" |
56 | | - > |
57 | | - {#if grade !== TaskGrade.PENDING} |
58 | | - {grade} |
59 | | - {:else} |
60 | | - ?? |
61 | | - {/if} |
62 | | - </div> |
| 52 | + <GradeLabel |
| 53 | + taskGrade={grade} |
| 54 | + defaultPadding={0.25} |
| 55 | + defaultWidth={12} |
| 56 | + reducedWidth={9} |
| 57 | + defaultTextSize="xl" |
| 58 | + /> |
63 | 59 |
|
64 | 60 | <ThermometerProgressBar {taskResults} /> |
65 | 61 | <AcceptedCounter {taskResults} /> |
|
0 commit comments