ScheduleRoot.tsx 836 Bytes
Newer Older
David Haynes's avatar
David Haynes committed
1
import * as React from 'react';
David Haynes's avatar
David Haynes committed
2
import { CourseSection } from '../util/CourseSection';
David Haynes's avatar
David Haynes committed
3
4
5
import ScheduleList from './ScheduleList';

interface SearchRootProps {
David Haynes's avatar
David Haynes committed
6
    schedule: CourseSection[];
David Haynes's avatar
David Haynes committed
7
    removeCourseSection: (courseSection: CourseSection) => any;
David Haynes's avatar
David Haynes committed
8
9
10
11
12
13
14
15
16
17
}

// const generateSchedule = (schedule: CourseEntry[]): void => {
//     const crns = schedule.map(entry => entry.crn);

//     postData(ENDPOINTS.generateCalendar, crns)
//         .then(response => response.text())
//         .then(icalText => downloadCalendar(icalText));
// };

David Haynes's avatar
David Haynes committed
18
const ScheduleRoot = ({ schedule, removeCourseSection }: SearchRootProps) => (
David Haynes's avatar
David Haynes committed
19
    <div>
David Haynes's avatar
David Haynes committed
20
        <ScheduleList courses={schedule} selectCourseCallback={removeCourseSection} />
David Haynes's avatar
David Haynes committed
21
22
23
24
25
        {/* <button onClick={generateSchedule}>Generate Schedule</button> */}
    </div>
);

export default ScheduleRoot;