ScheduleRoot.tsx 810 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
7
    schedule: CourseSection[];
    removeEntry: (CourseEntry: CourseSection) => any;
David Haynes's avatar
David Haynes committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
}

// 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;