import React from 'react'; import { Box, Card, CardContent, Typography, Button, LinearProgress, List, ListItem, ListItemIcon, ListItemText, ListItemButton, Divider, Chip, Stack } from '@mui/material'; import { Dashboard as DashboardIcon, Person as PersonIcon, Article as ArticleIcon, Description as DescriptionIcon, Quiz as QuizIcon, Analytics as AnalyticsIcon, Settings as SettingsIcon, Add as AddIcon, Visibility as VisibilityIcon, Download as DownloadIcon, ContactMail as ContactMailIcon, Edit as EditIcon, TipsAndUpdates as TipsIcon, SettingsBackupRestore } from '@mui/icons-material'; import { useAuth } from 'hooks/AuthContext'; import { LoadingPage } from './LoadingPage'; import { LoginRequired } from './LoginRequired'; import { BackstoryPageProps } from 'components/BackstoryTab'; import { Navigate, useNavigate } from 'react-router-dom'; interface DashboardProps extends BackstoryPageProps { userName?: string; profileCompletion?: number; } const CandidateDashboardPage: React.FC = (props: DashboardProps) => { const navigate = useNavigate(); const { setSnack } = props; const { user, isLoading, isInitializing, isAuthenticated } = useAuth(); const profileCompletion = 75; const sidebarItems = [ { icon: , text: 'Dashboard', active: true }, { icon: , text: 'Profile', active: false }, { icon: , text: 'Backstory', active: false }, { icon: , text: 'Resumes', active: false }, { icon: , text: 'Q&A Setup', active: false }, { icon: , text: 'Analytics', active: false }, { icon: , text: 'Settings', active: false }, ]; if (isLoading || isInitializing) { return (); } if (!user || !isAuthenticated) { return (); } if (user.userType !== 'candidate') { setSnack(`The page you were on is only available for candidates (you are a ${user.userType}`, 'warning'); navigate('/'); return (<>); } return ( {/* Sidebar */} JobPortal {sidebarItems.map((item, index) => ( {item.icon} ))} {/* Main Content */} {/* Welcome Section */} Welcome back, {user.firstName}! Your profile is {profileCompletion}% complete {/* Cards Grid */} {/* Top Row */} {/* Resume Builder Card */} Resume Builder 3 custom resumes Last created: May 15, 2025 {/* Recent Activity Card */} Recent Activity 5 profile views 2 resume downloads 1 direct contact {/* Bottom Row */} {/* Complete Your Backstory Card */} Complete Your Backstory • Add projects • Detail skills • Work history {/* Improvement Suggestions Card */} Improvement Suggestions • Add certifications • Enhance your project details ); }; export { CandidateDashboardPage };