diff --git a/cv-engine/src/App.tsx b/cv-engine/src/App.tsx index e626af4..0986189 100644 --- a/cv-engine/src/App.tsx +++ b/cv-engine/src/App.tsx @@ -1,6 +1,9 @@ import React from 'react'; import Stepper from './components/Stepper'; import PersonalEditor from './editors/PersonalEditor'; +import WorkEditor from './editors/WorkEditor'; +import EducationEditor from './editors/EducationEditor'; +import SkillsEditor from './editors/SkillsEditor'; import PreviewPanel from './components/PreviewPanel'; import { useActiveStep } from './store/cvStore'; @@ -13,11 +16,11 @@ const App: React.FC = () => { case 'personal': return ; case 'work': - return
Work Experience editor will be implemented in M2
; + return ; case 'education': - return
Education editor will be implemented in M2
; + return ; case 'skills': - return
Skills editor will be implemented in M2
; + return ; case 'summary': return
Summary editor will be implemented in M3
; case 'finalize': diff --git a/cv-engine/src/editors/EducationEditor.tsx b/cv-engine/src/editors/EducationEditor.tsx new file mode 100644 index 0000000..e3d924b --- /dev/null +++ b/cv-engine/src/editors/EducationEditor.tsx @@ -0,0 +1,130 @@ +import React from 'react'; +import { useEducationData, useCvStore } from '../store/cvStore'; + +const EducationEditor: React.FC = () => { + const education = useEducationData(); + const { addEducationItem, updateEducationItem, removeEducationItem, reorderEducationItems } = useCvStore(); + + const handleFieldChange = (id: string, field: string, value: string) => { + updateEducationItem(id, { [field]: value } as any); + }; + + return ( +
+
+

Education

+ +
+ + {education.length === 0 && ( +

No education items yet. Click "Add Education" to start.

+ )} + +
+ {education.map((ed, idx) => { + const requiredError = { + degree: !ed.degree, + school: !ed.school, + startDate: !ed.startDate, + }; + return ( +
+
+
Education #{idx + 1}
+
+ + + +
+
+ +
+
+ + handleFieldChange(ed.id, 'degree', e.target.value)} + className={`w-full px-3 py-2 border rounded-md ${requiredError.degree ? 'border-red-500' : 'border-gray-300'}`} + /> + {requiredError.degree &&

Degree is required

} +
+
+ + handleFieldChange(ed.id, 'school', e.target.value)} + className={`w-full px-3 py-2 border rounded-md ${requiredError.school ? 'border-red-500' : 'border-gray-300'}`} + /> + {requiredError.school &&

School name is required

} +
+
+
+ + handleFieldChange(ed.id, 'startDate', e.target.value)} + className={`w-full px-3 py-2 border rounded-md ${requiredError.startDate ? 'border-red-500' : 'border-gray-300'}`} + /> + {requiredError.startDate &&

Start date is required

} +
+
+ + handleFieldChange(ed.id, 'endDate', e.target.value)} + className="w-full px-3 py-2 border rounded-md border-gray-300" + /> +

Leave empty if ongoing

+
+
+
+ +
+ +