stud-manager / pages /Reports.tsx
dvc890's picture
Update pages/Reports.tsx
3962d2b verified
raw
history blame contribute delete
569 Bytes
import React from 'react';
import { api } from '../services/api';
import { TeacherReports } from './TeacherReports';
import { StudentReports } from './StudentReports';
import { SensitiveContentProtection } from '../components/SensitiveContentProtection';
export const Reports: React.FC = () => {
const currentUser = api.auth.getCurrentUser();
const isStudent = currentUser?.role === 'STUDENT';
if (isStudent) {
return <StudentReports />;
}
return (
<SensitiveContentProtection>
<TeacherReports />
</SensitiveContentProtection>
);
};