import { useState } from 'react'; import type { CertificationTrack } from '../../types/getcertV2'; import { ArrowLeft, ArrowRight, Shield, TrendingUp, CheckCircle2, ClipboardList, PenTool } from 'lucide-react'; import { resolveCanonicalCourseTitle } from '../../utils/courseTitleResolver'; interface CourseSelectionProps { onCourseSelect: (courseName: string, category?: string) => void; loading: boolean; onBackToDashboard: () => void; certificationTrack?: CertificationTrack | null; } export function CourseSelection({ onCourseSelect, loading, onBackToDashboard, certificationTrack }: CourseSelectionProps) { const [customCourse, setCustomCourse] = useState(''); const [selectedCategory, setSelectedCategory] = useState(null); // Popular course recommendations const recommendedCourses = [ { name: 'JavaScript Fundamentals', category: 'Programming', popularity: 95 }, { name: 'HTML & CSS Basics', category: 'Web Development', popularity: 92 }, { name: 'Git & Version Control', category: 'Developer Tools', popularity: 88 }, { name: 'Python Basics', category: 'Programming', popularity: 90 }, { name: 'WordPress Basics', category: 'CMS', popularity: 85 }, { name: 'Basic SQL', category: 'Databases', popularity: 87 }, { name: 'Graphic Design Basics', category: 'Design', popularity: 94 }, { name: 'UI / UX Design', category: 'Design', popularity: 96 }, { name: 'Digital Marketing', category: 'Marketing', popularity: 83 }, { name: 'Photoshop Basics', category: 'Design', popularity: 80 } ]; const categories = [ { name: 'Programming', count: 25 }, { name: 'Web Development', count: 18 }, { name: 'Design', count: 15 }, { name: 'Marketing', count: 12 }, { name: 'Developer Tools', count: 10 } ]; const handleCourseSubmit = () => { if (customCourse.trim()) { const canonical = resolveCanonicalCourseTitle(customCourse.trim()); onCourseSelect(canonical); } }; const handleKeyPress = (e: React.KeyboardEvent) => { if (e.key === 'Enter' && !loading) { handleCourseSubmit(); } }; const filteredCourses = selectedCategory ? recommendedCourses.filter(course => course.category === selectedCategory) : recommendedCourses; return (
{/* Header */}

Select Course or Enter Any Technical Domain

Enter any technical topic or skill to generate your syllabus, or choose from our curated courses below.

{/* Custom Course Input Scratchpad */}

Enter Any Technical Skill

setCustomCourse(e.target.value)} onKeyPress={handleKeyPress} placeholder="e.g. React 19, Distributed Systems, Rust Systems, Machine Learning..." className="flex-1 px-4 py-2.5 bg-slate-50 border border-slate-300 rounded-lg text-sm text-slate-900 focus:outline-none focus:border-[#132F50] focus:ring-2 focus:ring-[#132F50]/20 transition-all" disabled={loading} />
{/* Categories */}

Domain Categories

{categories.map((category) => ( ))}
{/* Recommended Courses Grid */}

{selectedCategory ? `${selectedCategory} Syllabi` : 'Accredited Curricula'}

Transcript Grounded
{filteredCourses.map((course, index) => { const canonicalName = resolveCanonicalCourseTitle(course.name); return ( ); })}
{/* Info Section */}

Certification Workflow

1
Learning Modules
Review core concepts with concise takeaways and practical code examples.
2
Assessment
Complete a comprehensive evaluation aligned directly with the curriculum.
3
Official Certificate
Receive your verified certificate with instant QR validation and PDF download.
); }