ScheduleItem.js
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import zoomSymbol from "../assets/zoom.png";
import ecampusSymbol from "../assets/e-Campus.png";
const ScheduleItem = ({ schedule }) => {
const {
name: subjectName,
color: subjectColor,
type,
label,
description,
url,
detail,
startTime = null,
endTime = null,
} = schedule;
const selectSymbol = () => {
let symbol;
switch (type) {
case "zoom":
symbol = zoomSymbol;
break;
case "assignment":
symbol = ecampusSymbol;
break;
default:
}
return symbol;
};
return (
<div className="ScheduleItem" style={{ borderColor: "#" + subjectColor }}>
<img className="s_symbol" src={selectSymbol()} alt="404" />
{startTime && (
<span className="s_start">{startTime[0] + ":" + startTime[1]}</span>
)}
{endTime && (
<span className="s_end">{endTime[0] + ":" + endTime[1]}</span>
)}
{/* <span className="s_category">{subjectName}</span> */}
<span className="s_slabel">{label}</span>
</div>
);
};
export default ScheduleItem;