import React, { useState } from 'react'; import { useAuth } from '../../context/AuthContext'; import { isAdmin as checkIsAdmin } from '../../utils/roleUtils'; import PageSection from '../common/PageSection'; import TaskForm from '../Task/TaskForm'; import TaskList from '../Task/TaskList'; import AdminPanel from '../Admin/AdminPanel'; const Dashboard = () => { const { user } = useAuth(); const isAdmin = checkIsAdmin(user); const [taskRefreshKey, setTaskRefreshKey] = useState(0); return (

{isAdmin ? 'Administrator' : 'Team Member'}

Welcome back, {user?.fullName || user?.email}

Stay on top of your assignments, collaborate with your team, and keep tasks moving forward.

{isAdmin && ( )} setTaskRefreshKey((value) => value + 1)} />
); }; export default Dashboard;