import React from "react"; import { Pencil } from "lucide-react"; import { motion } from "framer-motion"; import { useResumeStore } from "@/store/useResumeStore"; import { cn } from "@/lib/utils"; import BasicPanel from "./basic/BasicPanel"; import EducationPanel from "./education/EducationPanel"; import ProjectPanel from "./project/ProjectPanel"; import ExperiencePanel from "./experience/ExperiencePanel"; import CustomPanel from "./custom/CustomPanel"; import SkillPanel from "./skills/SkillPanel"; import SelfEvaluationPanel from "./self-evaluation/SelfEvaluationPanel"; import CertificatesPanel from "./certificates/CertificatesPanel"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../ui/tooltip"; export function EditPanel() { const { activeResume, updateMenuSections } = useResumeStore(); if (!activeResume) return; const { activeSection = "", menuSections = [] } = activeResume || {}; const renderFields = () => { switch (activeSection) { case "basic": return ; case "projects": return ; case "education": return ; case "experience": return ; case "skills": return ; case "selfEvaluation": return ; case "certificates": return ; default: if (activeSection?.startsWith("custom")) { return ; } else { return ; } } }; return (
{menuSections?.find((s) => s.id === activeSection)?.icon} {/* 如果是基本信息的展示话展示div */} {activeSection === "basic" ? (
{menuSections?.find((s) => s.id === activeSection)?.title}
) : ( <> s.id === activeSection)?.title } onChange={(e) => { const newMenuSections = menuSections.map((s) => { if (s.id === activeSection) { return { ...s, title: e.target.value, }; } return s; }); updateMenuSections(newMenuSections); }} />

点击文字部分即可聚焦编辑

)}
{renderFields()}
); }