"use client"; import { useState, useEffect } from "react"; import BackToMC from "@/components/mission-control/BackToMC"; interface Experience { id: string; title: string; company: string; period: string; description: string; } interface Education { id: string; degree: string; school: string; year: string; } interface Skill { id: string; name: string; } export default function ResumeBuilderPage() { const [activeTab, setActiveTab] = useState<"edit" | "preview">("edit"); const [resumeName, setResumeName] = useState("My Resume"); // Personal Info const [personalInfo, setPersonalInfo] = useState({ name: "Your Name", title: "Professional Title", email: "email@example.com", phone: "+34 XXX XXX XXX", location: "City, Country", website: "www.yoursite.com", linkedin: "linkedin.com/in/yourprofile", summary: "A brief professional summary..." }); // Experience const [experiences, setExperiences] = useState([ { id: "1", title: "Job Title", company: "Company Name", period: "2020 - Present", description: "Key responsibilities and achievements in this role." } ]); // Education const [education, setEducation] = useState([ { id: "1", degree: "Degree Name", school: "University Name", year: "2016 - 2020" } ]); // Skills const [skills, setSkills] = useState([ { id: "1", name: "Skill 1" }, { id: "2", name: "Skill 2" }, { id: "3", name: "Skill 3" } ]); const [languages, setLanguages] = useState([ { id: "1", name: "Language 1", level: "Fluent" }, { id: "2", name: "Language 2", level: "Native" } ]); // Versions const [versions, setVersions] = useState(["Default"]); const [currentVersion, setCurrentVersion] = useState("Default"); // CRUD operations const addExperience = () => { setExperiences([...experiences, { id: Date.now().toString(), title: "New Position", company: "Company", period: "2023 - Present", description: "Description..." }]); }; const removeExperience = (id: string) => { setExperiences(experiences.filter(e => e.id !== id)); }; const updateExperience = (id: string, field: keyof Experience, value: string) => { setExperiences(experiences.map(e => e.id === id ? { ...e, [field]: value } : e)); }; const addEducation = () => { setEducation([...education, { id: Date.now().toString(), degree: "New Degree", school: "School Name", year: "2020 - 2024" }]); }; const removeEducation = (id: string) => { setEducation(education.filter(e => e.id !== id)); }; const updateEducation = (id: string, field: keyof Education, value: string) => { setEducation(education.map(e => e.id === id ? { ...e, [field]: value } : e)); }; const addSkill = () => { setSkills([...skills, { id: Date.now().toString(), name: "New Skill" }]); }; const removeSkill = (id: string) => { setSkills(skills.filter(s => s.id !== id)); }; const updateSkill = (id: string, name: string) => { setSkills(skills.map(s => s.id === id ? { ...s, name } : s)); }; const saveVersion = () => { const name = prompt("Enter version name:", `Resume - ${currentVersion}`); if (name && !versions.includes(name)) { setVersions([...versions, name]); setCurrentVersion(name); alert(`Version "${name}" saved!`); } }; const loadVersion = (version: string) => { setCurrentVersion(version); }; const deleteVersion = (version: string) => { if (versions.length > 1) { setVersions(versions.filter(v => v !== version)); if (currentVersion === version) { setCurrentVersion(versions[0]); } } }; const handlePrint = () => { window.print(); }; return (
{/* Toolbar */}

📄 Resume Builder

{activeTab === "edit" ? (
{/* Personal Info */}

👤 Personal Information

setPersonalInfo({...personalInfo, name: e.target.value})} className="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-white" />
setPersonalInfo({...personalInfo, title: e.target.value})} className="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-white" />
setPersonalInfo({...personalInfo, email: e.target.value})} className="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-white" />
setPersonalInfo({...personalInfo, phone: e.target.value})} className="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-white" />
setPersonalInfo({...personalInfo, location: e.target.value})} className="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-white" />
setPersonalInfo({...personalInfo, website: e.target.value})} className="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-white" />