uchill/front_minimal/src/app/dashboard/page.jsx

39 lines
1015 B
JavaScript

'use client';
import { CONFIG } from 'src/config-global';
import { useAuthContext } from 'src/auth/hooks';
// Временно импортируем только ментора (позже добавим клиента и родителя)
import { OverviewCourseView } from 'src/sections/overview/course/view';
export default function Page() {
const { user, loading } = useAuthContext();
if (loading) {
return <div>Загрузка...</div>;
}
if (!user) {
return null;
}
// Роутинг по ролям
if (user.role === 'mentor') {
return <OverviewCourseView />;
}
if (user.role === 'client') {
return <div>Дашборд Клиента (в разработке)</div>;
}
if (user.role === 'parent') {
return <div>Дашборд Родителя (в разработке)</div>;
}
return (
<div style={{ padding: '24px', textAlign: 'center' }}>
<p>Неизвестная роль пользователя: {user.role}</p>
</div>
);
}