ScheduleRoot.tsx 1.14 KB
Newer Older
David Haynes's avatar
David Haynes committed
1
import * as React from 'react';
2
3
import CourseSection from '../util/CourseSection';
import ScheduleBadge from './ScheduleBadge';
David Haynes's avatar
David Haynes committed
4

5
interface ScheduleRootProps {
David Haynes's avatar
David Haynes committed
6
    schedule: CourseSection[];
David Haynes's avatar
David Haynes committed
7
    removeCourseSection: (courseSection: CourseSection) => any;
8
9
10
    generateCalendarUrl: () => string;
    openCalendarAsWebcal: () => void;
    downloadIcs: () => Promise<void>;
David Haynes's avatar
David Haynes committed
11
12
}

13
14
15
16
17
/**
 * Weird component that renders the ScheduleBadge
 *
 * TODO: Remove this component? Or maybe refactor some of ScheduleBadge into this
 */
18
19
20
21
22
23
24
const ScheduleRoot = ({
    schedule,
    removeCourseSection,
    generateCalendarUrl,
    openCalendarAsWebcal,
    downloadIcs,
}: ScheduleRootProps) => (
David Haynes's avatar
David Haynes committed
25
    <div>
26
27
28
        <ScheduleBadge
            schedule={schedule}
            removeCourseSection={removeCourseSection}
29
30
31
            generateCalendarUrl={generateCalendarUrl}
            openCalendarAsWebcal={openCalendarAsWebcal}
            downloadIcs={downloadIcs}
32
        />
33
        {/* <ScheduleList courses={schedule} selectCourseCallback={removeCourseSection} /> */}
David Haynes's avatar
David Haynes committed
34
35
36
37
38
        {/* <button onClick={generateSchedule}>Generate Schedule</button> */}
    </div>
);

export default ScheduleRoot;