// Phase 3B: Staff Training and Adoption System for AI Platform import React, { useState, useEffect } from 'react' import { motion, AnimatePresence } from 'framer-motion' interface TrainingModule { id: string title: string description: string duration: number // in minutes difficulty: 'beginner' | 'intermediate' | 'advanced' category: 'ai-basics' | 'system-navigation' | 'case-management' | 'reporting' | 'troubleshooting' prerequisites: string[] learningObjectives: string[] completed: boolean score?: number lastAttempt?: Date certificateEarned: boolean } interface StaffMember { id: string name: string role: string department: string email: string startDate: Date trainingProgress: number completedModules: string[] certificatesEarned: string[] lastLogin?: Date proficiencyLevel: 'novice' | 'competent' | 'proficient' | 'expert' } // Training session interface for future implementation interface OnboardingChecklist { id: string staffId: string items: ChecklistItem[] completedItems: number totalItems: number assignedMentor?: string startDate: Date targetCompletionDate: Date } interface ChecklistItem { id: string title: string description: string category: 'account-setup' | 'training' | 'practice' | 'certification' | 'mentoring' completed: boolean completedDate?: Date notes?: string required: boolean } const StaffTrainingDashboard: React.FC = () => { const [staff, setStaff] = useState([]) const [modules, setModules] = useState([]) const [currentView, setCurrentView] = useState<'overview' | 'training' | 'progress' | 'onboarding'>('overview') // const [selectedStaff, setSelectedStaff] = useState(null) // For future staff detail view const [selectedModule, setSelectedModule] = useState(null) const [onboardingData, setOnboardingData] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { loadTrainingData() }, []) const loadTrainingData = async () => { setLoading(true) // Simulate loading training modules const trainingModules: TrainingModule[] = [ { id: 'mod-001', title: 'Introduction to AI-Powered Student Assistance', description: 'Learn the basics of how our AI system helps match student needs with available resources.', duration: 30, difficulty: 'beginner', category: 'ai-basics', prerequisites: [], learningObjectives: [ 'Understand the purpose and benefits of AI assistance', 'Identify key components of the AI system', 'Recognize when AI recommendations are most valuable' ], completed: false, certificateEarned: false }, { id: 'mod-002', title: 'Navigating the AI Portal Interface', description: 'Master the AI portal interface, including request submission, review queues, and status monitoring.', duration: 45, difficulty: 'beginner', category: 'system-navigation', prerequisites: ['mod-001'], learningObjectives: [ 'Navigate all sections of the AI portal', 'Submit and track assistance requests', 'Interpret AI confidence scores and recommendations' ], completed: false, certificateEarned: false }, { id: 'mod-003', title: 'Case Management with AI Assistance', description: 'Learn to effectively manage student cases using AI recommendations and Salesforce integration.', duration: 60, difficulty: 'intermediate', category: 'case-management', prerequisites: ['mod-001', 'mod-002'], learningObjectives: [ 'Create and update cases in Salesforce', 'Evaluate AI matching recommendations', 'Coordinate with volunteers and resource providers', 'Track case outcomes and impact' ], completed: false, certificateEarned: false }, { id: 'mod-004', title: 'Advanced Analytics and Reporting', description: 'Utilize the analytics dashboard to track impact, identify trends, and generate reports.', duration: 50, difficulty: 'intermediate', category: 'reporting', prerequisites: ['mod-003'], learningObjectives: [ 'Generate impact reports using the dashboard', 'Identify trends in student assistance needs', 'Use predictive analytics for resource planning', 'Create custom reports for stakeholders' ], completed: false, certificateEarned: false }, { id: 'mod-005', title: 'Troubleshooting and System Optimization', description: 'Handle common issues, optimize AI performance, and maintain data quality.', duration: 40, difficulty: 'advanced', category: 'troubleshooting', prerequisites: ['mod-004'], learningObjectives: [ 'Diagnose and resolve common system issues', 'Optimize AI model performance through feedback', 'Maintain data quality and integrity', 'Escalate complex technical problems appropriately' ], completed: false, certificateEarned: false } ] // Simulate loading staff data const staffMembers: StaffMember[] = [ { id: 'staff-001', name: 'Jennifer Martinez', role: 'Case Manager', department: 'Student Services', email: 'jennifer.m@miraclesinmotion.org', startDate: new Date('2024-01-15'), trainingProgress: 80, completedModules: ['mod-001', 'mod-002', 'mod-003'], certificatesEarned: ['AI Basics Certified'], lastLogin: new Date('2024-10-04'), proficiencyLevel: 'competent' }, { id: 'staff-002', name: 'Michael Chen', role: 'Volunteer Coordinator', department: 'Operations', email: 'michael.c@miraclesinmotion.org', startDate: new Date('2023-08-20'), trainingProgress: 100, completedModules: ['mod-001', 'mod-002', 'mod-003', 'mod-004', 'mod-005'], certificatesEarned: ['AI Expert Certified', 'Advanced Analytics Certified'], lastLogin: new Date('2024-10-05'), proficiencyLevel: 'expert' }, { id: 'staff-003', name: 'Sarah Williams', role: 'Program Manager', department: 'Programs', email: 'sarah.w@miraclesinmotion.org', startDate: new Date('2024-09-01'), trainingProgress: 40, completedModules: ['mod-001', 'mod-002'], certificatesEarned: [], lastLogin: new Date('2024-10-03'), proficiencyLevel: 'novice' }, { id: 'staff-004', name: 'David Rodriguez', role: 'Data Analyst', department: 'Analytics', email: 'david.r@miraclesinmotion.org', startDate: new Date('2024-02-10'), trainingProgress: 90, completedModules: ['mod-001', 'mod-002', 'mod-003', 'mod-004'], certificatesEarned: ['AI Basics Certified', 'Analytics Certified'], lastLogin: new Date('2024-10-05'), proficiencyLevel: 'proficient' } ] // Simulate onboarding checklists const onboardingChecklists: OnboardingChecklist[] = [ { id: 'onboard-003', staffId: 'staff-003', completedItems: 6, totalItems: 12, assignedMentor: 'staff-002', startDate: new Date('2024-09-01'), targetCompletionDate: new Date('2024-10-15'), items: [ { id: 'check-001', title: 'Complete AI System Account Setup', description: 'Create login credentials and verify access', category: 'account-setup', completed: true, required: true }, { id: 'check-002', title: 'Complete Module 1: AI Basics', description: 'Understand fundamental AI concepts', category: 'training', completed: true, required: true }, { id: 'check-003', title: 'Complete Module 2: System Navigation', description: 'Learn to navigate the AI portal', category: 'training', completed: true, required: true }, { id: 'check-004', title: 'Shadow Experienced Case Manager', description: 'Observe real case management workflows', category: 'mentoring', completed: true, required: true }, { id: 'check-005', title: 'Process First Practice Case', description: 'Handle a low-complexity practice case', category: 'practice', completed: true, required: true }, { id: 'check-006', title: 'Complete Module 3: Case Management', description: 'Master case management with AI assistance', category: 'training', completed: true, required: true }, { id: 'check-007', title: 'Process 5 Real Cases Under Supervision', description: 'Gain hands-on experience with mentor oversight', category: 'practice', completed: false, required: true }, { id: 'check-008', title: 'Complete Module 4: Analytics & Reporting', description: 'Learn to generate and interpret reports', category: 'training', completed: false, required: false }, { id: 'check-009', title: 'Pass AI Certification Exam', description: 'Demonstrate competency in AI system usage', category: 'certification', completed: false, required: true }, { id: 'check-010', title: 'Independent Case Processing Approval', description: 'Get approval for unsupervised case management', category: 'certification', completed: false, required: true }, { id: 'check-011', title: 'Complete Troubleshooting Training', description: 'Learn to handle common system issues', category: 'training', completed: false, required: false }, { id: 'check-012', title: 'Final Performance Review', description: 'Comprehensive evaluation of skills and readiness', category: 'certification', completed: false, required: true } ] } ] setModules(trainingModules) setStaff(staffMembers) setOnboardingData(onboardingChecklists) setLoading(false) } const getProficiencyColor = (level: string) => { switch (level) { case 'expert': return 'text-purple-600 bg-purple-100' case 'proficient': return 'text-blue-600 bg-blue-100' case 'competent': return 'text-green-600 bg-green-100' case 'novice': return 'text-orange-600 bg-orange-100' default: return 'text-gray-600 bg-gray-100' } } const getDifficultyColor = (difficulty: string) => { switch (difficulty) { case 'advanced': return 'bg-red-500' case 'intermediate': return 'bg-yellow-500' case 'beginner': return 'bg-green-500' default: return 'bg-gray-500' } } const getCategoryIcon = (category: string) => { switch (category) { case 'ai-basics': return '🧠' case 'system-navigation': return 'πŸ—ΊοΈ' case 'case-management': return 'πŸ“‹' case 'reporting': return 'πŸ“Š' case 'troubleshooting': return 'πŸ”§' default: return 'πŸ“š' } } if (loading) { return (
Loading Training System...
) } return (
{/* Header */}

AI Training & Adoption Center

Empowering our team with comprehensive AI system training

{(['overview', 'training', 'progress', 'onboarding'] as const).map((view) => ( ))}
{/* Overview Dashboard */} {currentView === 'overview' && (

Total Staff

πŸ‘₯
{staff.length}
Across all departments

Avg. Progress

πŸ“ˆ
{Math.round(staff.reduce((acc, s) => acc + s.trainingProgress, 0) / staff.length)}%
Training completion

Certificates

πŸ†
{staff.reduce((acc, s) => acc + s.certificatesEarned.length, 0)}
Total earned

Experts

⭐
{staff.filter(s => s.proficiencyLevel === 'expert' || s.proficiencyLevel === 'proficient').length}
Proficient+ level
)} {/* Training Modules */} {currentView === 'training' && ( {modules.map((module) => (
{getCategoryIcon(module.category)}

{module.title}

{module.duration} minutes

{module.difficulty}

{module.description}

Learning Objectives:

    {module.learningObjectives.slice(0, 2).map((objective, index) => (
  • β€’ {objective}
  • ))} {module.learningObjectives.length > 2 && (
  • +{module.learningObjectives.length - 2} more...
  • )}
Prerequisites: {module.prerequisites.length > 0 ? module.prerequisites.length : 'None'}
))}
)} {/* Staff Progress */} {currentView === 'progress' && (

Staff Training Progress

{staff.map((member) => (

{member.name}

{member.role} β€’ {member.department}

{member.proficiencyLevel.toUpperCase()}
Last login: {member.lastLogin?.toLocaleDateString() || 'Never'}
Training Progress {member.trainingProgress}%
Modules Completed:
{member.completedModules.length}/{modules.length}
Certificates:
{member.certificatesEarned.length}
Start Date:
{member.startDate.toLocaleDateString()}
{member.certificatesEarned.length > 0 && (
{member.certificatesEarned.map(cert => ( πŸ† {cert} ))}
)}
))}
)} {/* Onboarding Checklist */} {currentView === 'onboarding' && ( {onboardingData.map((checklist) => { const staffMember = staff.find(s => s.id === checklist.staffId) const mentor = staff.find(s => s.id === checklist.assignedMentor) return (

Onboarding: {staffMember?.name}

{staffMember?.role} β€’ Mentor: {mentor?.name}

{checklist.completedItems}/{checklist.totalItems}
Items Complete
Overall Progress {Math.round((checklist.completedItems / checklist.totalItems) * 100)}%
{checklist.items.map((item) => (
{item.completed ? 'βœ…' : '⏳'}

{item.title}

{item.required && ( Required )}

{item.description}

{item.completed && item.completedDate && (

Completed: {item.completedDate.toLocaleDateString()}

)}
{item.category.replace('-', ' ')}
))}
) })}
)}
{/* Module Details Modal */} {selectedModule && ( setSelectedModule(null)} > e.stopPropagation()} >

{selectedModule.title}

{selectedModule.description}

Duration:
{selectedModule.duration} minutes
Difficulty:
{selectedModule.difficulty}
Category:
{selectedModule.category.replace('-', ' ')}
Prerequisites:
{selectedModule.prerequisites.length > 0 ? selectedModule.prerequisites.length : 'None'}

Learning Objectives

    {selectedModule.learningObjectives.map((objective, index) => (
  • βœ“ {objective}
  • ))}
)}
) } export default StaffTrainingDashboard