Coursemology/coursemology2

View on GitHub
client/app/bundles/course/statistics/pages/StatisticsIndex/students/StudentsStatistics.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { FC } from 'react';

import { fetchStudentStatistics } from 'course/statistics/operations';
import LoadingIndicator from 'lib/components/core/LoadingIndicator';
import Preload from 'lib/components/wrappers/Preload';

import StudentsStatisticsTable from './StudentStatisticsTable';

const StudentsStatistics: FC = () => {
  return (
    <Preload render={<LoadingIndicator />} while={fetchStudentStatistics}>
      {(data) => (
        <StudentsStatisticsTable
          metadata={data.metadata}
          students={data.students}
        />
      )}
    </Preload>
  );
};

export default StudentsStatistics;