CourseSectionList.tsx 847 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
26
27
28
import * as React from 'react';
import CourseSection from '../util/CourseSection';
import CourseSectionCard from './CourseSectionCard';

interface CourseSectionListProps {
    courseSections: CourseSection[];
    courseSectionAction: (courseSection: CourseSection) => void;
    courseSectionActionButtonText: string;
}

const CourseSectionList = ({
    courseSections,
    courseSectionAction,
    courseSectionActionButtonText,
}: CourseSectionListProps) => (
    <div>
        {courseSections.map(courseSection => (
            <CourseSectionCard
                key={courseSection.crn}
                courseSection={courseSection}
                courseSectionAction={courseSectionAction}
                courseSectionActionButtonText={courseSectionActionButtonText}
            />
        ))}
    </div>
);

export default CourseSectionList;