diff --git a/src/components/MilestoneTracker.js b/src/components/MilestoneTracker.js new file mode 100644 index 0000000..c513ac6 --- /dev/null +++ b/src/components/MilestoneTracker.js @@ -0,0 +1,212 @@ +import React, { useState } from "react"; +import { Card, CardContent } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { Progress } from "@/components/ui/progress"; +import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; +import { CheckCircle, Clock, Target, PlusCircle, Search } from "lucide-react"; +import { Input } from "@/components/ui/input"; +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"; + +const careerClusters = [ + "Software Development", + "Healthcare", + "Engineering", + "Finance", + "Education", + "Marketing", + "Cybersecurity", + "Construction", + "Legal", + "Data Science", + "Sales", + "Human Resources", + "Manufacturing", + "Aviation", + "Social Work", + "Design & UX", + "Hospitality", + "Retail Management", + "Real Estate", + "Transportation", + "Agriculture", + "Public Administration", + "Energy & Environment" +]; + +const universalPrerequisites = { + "Software Development": ["Learn a Programming Language", "Build and Deploy a Small Project", "Understand Data Structures & Algorithms"], + "Healthcare": ["Complete Required Certifications", "Pass Licensing Exam", "Gain Clinical Experience"], + "Engineering": ["Earn a Relevant Engineering Degree", "Obtain Engineering Certification (PE/EIT)", "Gain Hands-on Experience"], + "Finance": ["Earn a Bachelor's in Finance or Related Field", "Gain Experience with Financial Modeling", "Obtain CFA or CPA Certification"], + "Education": ["Complete a Teaching Credential", "Pass State Licensing Exam", "Gain Classroom Experience"], + "Marketing": ["Learn Digital Marketing Basics", "Build a Portfolio of Campaigns", "Gain Experience in Market Research"], + "Cybersecurity": ["Learn Network Security Fundamentals", "Obtain CompTIA Security+ or CISSP", "Gain Hands-on Security Experience"], + "Construction": ["Complete an Apprenticeship Program", "Earn a Safety Certification (OSHA)", "Gain On-Site Experience"], + "Legal": ["Earn a Law Degree (JD)", "Pass the Bar Exam", "Gain Internship Experience at a Law Firm"], + "Data Science": ["Learn Python & SQL", "Complete a Machine Learning Course", "Build a Data Science Portfolio"], + "Sales": ["Develop Strong Communication Skills", "Understand CRM Tools", "Gain Sales Experience"], + "Human Resources": ["Earn a Bachelor's in HR or Business", "Obtain PHR or SHRM Certification", "Gain HR Generalist Experience"], + "Manufacturing": ["Learn Manufacturing Processes", "Complete a Safety Training Course", "Gain Hands-on Experience in Production"], + "Aviation": ["Earn a Pilot’s License", "Pass FAA Certification Exams", "Gain Flight Hours"], + "Social Work": ["Earn a Social Work Degree", "Obtain State Licensing", "Gain Casework Experience"], + "Design & UX": ["Learn UI/UX Design Principles", "Build a Portfolio of Designs", "Gain Experience with Design Tools (Figma, Adobe XD)"], + "Hospitality": ["Gain Customer Service Experience", "Complete Hospitality Management Courses", "Develop Event Planning Skills"], + "Retail Management": ["Gain Experience in Retail Operations", "Learn Inventory & Budget Management", "Develop Leadership Skills"], + "Real Estate": ["Earn a Real Estate License", "Develop Sales & Negotiation Skills", "Understand Market Trends"], + "Transportation": ["Obtain a Commercial Driver's License (CDL)", "Complete Logistics Training", "Gain Hands-on Experience in Transportation"], + "Agriculture": ["Learn Crop & Soil Science Basics", "Understand Farm Equipment Operation", "Gain Hands-on Farming Experience"], + "Public Administration": ["Earn a Public Administration Degree", "Understand Government Policies & Regulations", "Gain Leadership Experience"], + "Energy & Environment": ["Learn Renewable Energy Technologies", "Understand Environmental Regulations", "Gain Fieldwork Experience"] + }; + +const MilestoneTracker = () => { + const [activeTab, setActiveTab] = useState("career"); + const [customMilestones, setCustomMilestones] = useState({ career: [], financial: [], retirement: [] }); + const [isDialogOpen, setIsDialogOpen] = useState(false); + const [newMilestone, setNewMilestone] = useState(""); + const [careerSearch, setCareerSearch] = useState(""); + const [filteredCareers, setFilteredCareers] = useState(careerClusters); + + + useEffect(() => { + const fetchUserProfile = async () => { + try { + const response = await fetch("/api/user/profile", { + method: "GET", + credentials: "include", // Ensure cookies/session are sent + }); + if (response.ok) { + const data = await response.json(); + setIsPremiumUser(data.is_premium === 1); // Expecting { is_premium: 0 or 1 } + } else { + setIsPremiumUser(false); // Default to false if there's an error + } + } catch (error) { + console.error("Error fetching user profile:", error); + setIsPremiumUser(false); + } + }; + fetchUserProfile(); + }, []); + + if (isPremiumUser === null) { + return
Upgrade to Aptiva Premium to access the Milestone Tracker.
+ +