ScheduleRoot.tsx 802 Bytes
Newer Older
David Haynes's avatar
David Haynes committed
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
import * as React from 'react';
import { CourseEntry } from '../util/CourseEntry';
import ScheduleList from './ScheduleList';

interface SearchRootProps {
    schedule: CourseEntry[];
    removeEntry: (CourseEntry: CourseEntry) => any;
}

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

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

const ScheduleRoot = ({ schedule, removeEntry }: SearchRootProps) => (
    <div>
        <ScheduleList courses={schedule} selectCourseCallback={removeEntry} />
        {/* <button onClick={generateSchedule}>Generate Schedule</button> */}
    </div>
);

export default ScheduleRoot;