File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
overload/src/app/course-details/[...courseCode] Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export default function Page({ params }: { params: { courseCode: string } }) {
11
11
doomness : 0 ,
12
12
} ) ;
13
13
const [ isModalOpen , setIsModalOpen ] = useState ( false ) ;
14
+ const doomColors : { [ key : number ] : string } = { 1 : 'bg-green-500' , 2 : 'bg-yellow-500' , 3 : 'bg-red-500' }
14
15
15
16
useEffect ( ( ) => {
16
17
const populatePage = async ( ) => {
@@ -38,9 +39,7 @@ export default function Page({ params }: { params: { courseCode: string } }) {
38
39
< div className = "flex flex-col items-center flex-grow" >
39
40
< div className = "text-4xl font-bold mb-10" > OverLoad Scale</ div >
40
41
< div
41
- className = { `w-80 h-80 rounded-full object-cover ${
42
- courseData . doomness == 1 ? 'bg-green-500' : 'bg-red-500'
43
- } `}
42
+ className = { `w-80 h-80 rounded-full object-cover ${ doomColors [ courseData . doomness ] } ` }
44
43
>
45
44
< Image src = { skullSvg } alt = "skull-logo" > </ Image >
46
45
</ div >
You can’t perform that action at this time.
0 commit comments