SearchRoot.tsx 603 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
import * as React from 'react';
import SearchBar from '../components/SearchBar';
import SectionList from '../components/ScheduleList';
import { CourseEntry } from '../util/CourseEntry';

interface SearchRootProps {
    searchResults: CourseEntry[];
    searchCourses: (crn: string) => void;
    addEntry: (entry: CourseEntry) => void;
}

const SearchRoot = ({ searchResults, searchCourses, addEntry }: SearchRootProps) => (
    <div>
        <SearchBar onSearch={searchCourses} />
        <SectionList courses={searchResults} selectCourseCallback={addEntry} />
    </div>
);

export default SearchRoot;