summaryrefslogtreecommitdiff
path: root/src/screens/professor/Classroom/GradesTab/index.js
blob: 785bd50e8dedac6b482b2a4e63678384c277dd02 (plain)
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
function GradesTab({ gradesTabData, layoutType }) {
  const layoutResolver = (state, grades, layoutType) => {
    if (layoutType === 'desktop') {
      switch (state) {
        case 'loading':
          return <h1>Loading...</h1>;
        case 'idle':
          return <h1>Grades Tab</h1>;
        case 'gone':
          return null;
        default:
          return null;
      }
    } else if (layoutType === 'mobile') {
      switch (state) {
        case 'loading':
          return <h1>Loading...</h1>;
        case 'idle':
          return <h1>Grades Tab</h1>;
        case 'gone':
          return null;
        default:
          return null;
      }
    }
  };
  return layoutResolver(
    gradesTabData && gradesTabData.state,
    gradesTabData && gradesTabData.grades,
    layoutType
  );
}

export default GradesTab;