File size: 5,737 Bytes
9bc6cc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
function generateResumeContent(data, container) {
    // Generate Education section
    if (data.education && data.education.length > 0) {
        const educationSection = document.createElement('resume-section');
        educationSection.setAttribute('title', 'Education');
        educationSection.setAttribute('icon', 'book');
        
        let educationHTML = '<div class="space-y-6">';
        data.education.forEach(edu => {
            educationHTML += `
                <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                    <div class="flex justify-between items-start">
                        <div>
                            <h3 class="text-lg font-semibold">${edu.institution}</h3>
                            <p class="text-gray-600">${edu.degree} - ${edu.major}</p>
                        </div>
                        <span class="text-gray-500">${edu.startDate} - ${edu.endDate}</span>
                    </div>
                    <div class="mt-2">
                        <p class="text-gray-700"><span class="font-medium">GPA:</span> ${edu.gpa}</p>
                        <p class="text-gray-700 mt-1"><span class="font-medium">Courses:</span> ${edu.courses.join(', ')}</p>
                    </div>
                </div>
            `;
        });
        educationHTML += '</div>';
        educationSection.innerHTML = educationHTML;
        container.appendChild(educationSection);
    }

    // Generate Work Experience section
    if (data.workExperience && data.workExperience.length > 0) {
        const workSection = document.createElement('resume-section');
        workSection.setAttribute('title', 'Work Experience');
        workSection.setAttribute('icon', 'briefcase');
        
        let workHTML = '<div class="space-y-6">';
        data.workExperience.forEach(work => {
            workHTML += `
                <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                    <div class="flex justify-between items-start">
                        <div>
                            <h3 class="text-lg font-semibold">${work.company}</h3>
                            <p class="text-gray-600">${work.position}</p>
                        </div>
                        <span class="text-gray-500">${work.startDate} - ${work.endDate}</span>
                    </div>
                    <ul class="mt-4 space-y-3 list-disc list-inside text-gray-700">
                        ${work.responsibilities.map(resp => `<li>${resp}</li>`).join('')}
                    </ul>
                </div>
            `;
        });
        workHTML += '</div>';
        workSection.innerHTML = workHTML;
        container.appendChild(workSection);
    }

    // Generate Publications section
    if (data.publications && data.publications.length > 0) {
        const pubSection = document.createElement('resume-section');
        pubSection.setAttribute('title', 'Research Publications');
        pubSection.setAttribute('icon', 'file-text');
        
        let pubHTML = '<div class="space-y-6">';
        data.publications.forEach(pub => {
            pubHTML += `
                <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                    <h3 class="text-lg font-semibold">${pub.title}</h3>
                    <p class="text-gray-600 mt-1">${pub.authors} | ${pub.conference} | ${pub.year}</p>
                    <p class="text-gray-700 mt-2">${pub.description}</p>
                </div>
            `;
        });
        pubHTML += '</div>';
        pubSection.innerHTML = pubHTML;
        container.appendChild(pubSection);
    }

    // Generate Skills section
    if (data.skills && data.skills.length > 0) {
        const skillsSection = document.createElement('resume-section');
        skillsSection.setAttribute('title', 'Skills');
        skillsSection.setAttribute('icon', 'code');
        
        const skillsHTML = `
            <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                <ul class="space-y-3 list-disc list-inside text-gray-700">
                    ${data.skills.map(skill => `<li>${skill}</li>`).join('')}
                </ul>
            </div>
        `;
        skillsSection.innerHTML = skillsHTML;
        container.appendChild(skillsSection);
    }

    // Generate Awards section
    if (data.awards && data.awards.length > 0) {
        const awardsSection = document.createElement('resume-section');
        awardsSection.setAttribute('title', 'Awards');
        awardsSection.setAttribute('icon', 'award');
        
        let awardsHTML = '<div class="grid grid-cols-1 md:grid-cols-2 gap-4">';
        data.awards.forEach(award => {
            awardsHTML += `
                <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
                    <h4 class="font-medium">${award.name}</h4>
                    <p class="text-gray-600 text-sm mt-1">${award.date}</p>
                </div>
            `;
        });
        awardsHTML += '</div>';
        awardsSection.innerHTML = awardsHTML;
        container.appendChild(awardsSection);
    }

    // Generate Self Assessment section
    if (data.selfAssessment) {
        const selfSection = document.createElement('resume-section');
        selfSection.setAttribute('title', 'Self Assessment');
        selfSection.setAttribute('icon', 'user');
        
        const selfHTML = `
            <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                <p class="text-gray-700">${data.selfAssessment}</p>
            </div>
        `;
        selfSection.innerHTML = selfHTML;
        container.appendChild(selfSection);
    }
}