forked from tl-its-umich-edu/canvas-course-manager-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BulkEnrollUMUserToSectionsConfirmationTable.tsx
33 lines (25 loc) · 1.18 KB
/
BulkEnrollUMUserToSectionsConfirmationTable.tsx
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
29
30
31
32
33
import React, { useState } from 'react'
import CustomTable from './CustomTable.js'
import { RowNumberedAddEnrollmentWithSectionId } from '../models/enrollment.js'
interface BulkEnrollUMUserSectionsConfirmationTableProps {
enrollments: RowNumberedAddEnrollmentWithSectionId[]
}
interface TableHeaderColumnInfoShouldUseMatUIType {
id: keyof RowNumberedAddEnrollmentWithSectionId
label: string
minWidth: number
align?: 'left' | 'right' | undefined
}
const columns: TableHeaderColumnInfoShouldUseMatUIType[] = [
{ id: 'rowNumber', label: 'Row Number', minWidth: 25 },
{ id: 'loginId', label: 'Login ID', minWidth: 100 },
{ id: 'role', label: 'Role', minWidth: 100 },
{ id: 'sectionId', label: 'Section ID', minWidth: 100 }
]
function BulkEnrollUMUserSectionsConfirmationTable (props: BulkEnrollUMUserSectionsConfirmationTableProps): JSX.Element {
const [page, setPage] = useState<number>(0)
const tableRows = props.enrollments
const caption = `Data was found for ${props.enrollments.length} enrollments.`
return <CustomTable<RowNumberedAddEnrollmentWithSectionId> {...{ tableRows, columns, page, setPage, caption }} />
}
export default BulkEnrollUMUserSectionsConfirmationTable