@@ -6,6 +6,9 @@ import { ArrowRight, ArrowLeft, Download, Palette, Zap, Sparkles } from 'lucide-
66import Avatar from '@/components/Avatar' ;
77
88interface AvatarData {
9+ // Personal information
10+ name : string ;
11+
912 // Style questions
1013 primaryColor : string ;
1114 secondaryColor : string ;
@@ -21,6 +24,7 @@ interface AvatarData {
2124}
2225
2326const STEPS = [
27+ { id : 'name' , title : 'Personal Info' , icon : Palette } ,
2428 { id : 'style' , title : 'Design Style' , icon : Palette } ,
2529 { id : 'role' , title : 'Role & Organization' , icon : Zap } ,
2630 { id : 'keywords' , title : 'Expertise' , icon : Sparkles } ,
@@ -104,6 +108,7 @@ export default function MyAvatarPage() {
104108 const [ currentStep , setCurrentStep ] = useState ( 0 ) ;
105109 const [ showPreview , setShowPreview ] = useState ( false ) ;
106110 const [ avatarData , setAvatarData ] = useState < AvatarData > ( {
111+ name : '' ,
107112 primaryColor : '' ,
108113 secondaryColor : '' ,
109114 philosophy : '' ,
@@ -119,16 +124,19 @@ export default function MyAvatarPage() {
119124
120125 const isStepComplete = ( step : number ) => {
121126 switch ( step ) {
122- case 0 : // Philosophy selection
127+ case 0 : // Name input
128+ return avatarData . name . trim ( ) ;
129+ case 1 : // Philosophy selection
123130 return avatarData . philosophy ;
124- case 1 : // Working style selection
131+ case 2 : // Working style selection
125132 return avatarData . workingStyle ;
126- case 2 : // Role and organization
133+ case 3 : // Role and organization
127134 return avatarData . role && avatarData . organizationDescription ;
128- case 3 : // Keywords
135+ case 4 : // Keywords
129136 return avatarData . keywords [ 0 ] ?. trim ( ) ;
130- case 4 : // Final step - check all required fields
137+ case 5 : // Final step - check all required fields
131138 return (
139+ avatarData . name . trim ( ) &&
132140 avatarData . philosophy &&
133141 avatarData . workingStyle &&
134142 avatarData . role &&
@@ -159,6 +167,9 @@ export default function MyAvatarPage() {
159167 const generateXML = ( ) => {
160168 const xmlContent = `<?xml version="1.0" encoding="UTF-8"?>
161169<avatar>
170+ <personal>
171+ <name>${ avatarData . name } </name>
172+ </personal>
162173 <style>
163174 <primaryColor>${ avatarData . primaryColor } </primaryColor>
164175 <secondaryColor>${ avatarData . secondaryColor } </secondaryColor>
@@ -190,6 +201,31 @@ export default function MyAvatarPage() {
190201 const renderStep = ( ) => {
191202 switch ( currentStep ) {
192203 case 0 :
204+ return (
205+ < div className = "space-y-8" >
206+ < div className = "text-center" >
207+ < h2 className = "text-3xl font-bold text-foreground mb-4" > What's your name?</ h2 >
208+ < p className = "text-muted-foreground text-lg" > Let's start with the basics</ p >
209+ </ div >
210+
211+ < div className = "max-w-2xl mx-auto" >
212+ < div >
213+ < label className = "block text-sm font-medium text-foreground mb-2" >
214+ Your Name
215+ </ label >
216+ < input
217+ type = "text"
218+ value = { avatarData . name }
219+ onChange = { ( e ) => updateAvatarData ( 'name' , e . target . value ) }
220+ className = "w-full px-4 py-3 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-accent text-lg"
221+ placeholder = "Enter your name..."
222+ />
223+ </ div >
224+ </ div >
225+ </ div >
226+ ) ;
227+
228+ case 1 :
193229 return (
194230 < div className = "space-y-8" >
195231 < div className = "text-center" >
@@ -222,7 +258,7 @@ export default function MyAvatarPage() {
222258 </ div >
223259 ) ;
224260
225- case 1 :
261+ case 2 :
226262 return (
227263 < div className = "space-y-8" >
228264 < div className = "text-center" >
@@ -251,7 +287,7 @@ export default function MyAvatarPage() {
251287 </ div >
252288 ) ;
253289
254- case 2 :
290+ case 3 :
255291 return (
256292 < div className = "space-y-8" >
257293 < div className = "text-center" >
@@ -289,7 +325,7 @@ export default function MyAvatarPage() {
289325 </ div >
290326 ) ;
291327
292- case 3 :
328+ case 4 :
293329 return (
294330 < div className = "space-y-8" >
295331 < div className = "text-center" >
@@ -321,7 +357,7 @@ export default function MyAvatarPage() {
321357 </ div >
322358 ) ;
323359
324- case 4 :
360+ case 5 :
325361 return (
326362 < div className = "space-y-8" >
327363 < div className = "text-center" >
@@ -333,6 +369,11 @@ export default function MyAvatarPage() {
333369 { /* Summary Card */ }
334370 < div className = "bg-gradient-to-br from-background to-muted/20 p-8 rounded-2xl border border-border shadow-lg" >
335371 < div className = "space-y-4" >
372+ < div >
373+ < h4 className = "font-medium text-foreground mb-2" > Name</ h4 >
374+ < p className = "text-foreground" > { avatarData . name } </ p >
375+ </ div >
376+
336377 < div >
337378 < h4 className = "font-medium text-foreground mb-2" > Design Philosophy</ h4 >
338379 < p className = "text-accent capitalize" > { avatarData . philosophy } </ p >
@@ -402,56 +443,31 @@ export default function MyAvatarPage() {
402443 < div className = "bg-gradient-to-br from-background to-muted/20 p-8 rounded-2xl border border-border shadow-lg" >
403444 < div className = "flex items-center space-x-6 mb-6" >
404445 < div className = "relative" >
405- < Avatar name = "Your Name" size = { 80 } />
406- < div className = "absolute -bottom-1 -right-1 w-6 h-6 rounded-full border-2 border-background"
407- style = { { backgroundColor : avatarData . primaryColor } } />
446+ < Avatar
447+ name = { avatarData . name }
448+ size = { 80 }
449+ philosophy = { avatarData . philosophy }
450+ workingStyle = { avatarData . workingStyle }
451+ />
408452 </ div >
409453 < div className = "flex-1" >
410- < h3 className = "text-xl font-semibold text-foreground mb-1" > { avatarData . role } </ h3 >
411- < p className = "text-muted-foreground text-sm mb-2" > { avatarData . organizationDescription } </ p >
412- < div className = "flex items-center space-x-2" >
413- < span className = "text-xs text-muted-foreground" > Philosophy:</ span >
414- < span className = "text-xs font-medium text-accent capitalize" > { avatarData . philosophy } </ span >
415- </ div >
454+ < h3 className = "text-xl font-semibold text-foreground mb-1" > { avatarData . name } </ h3 >
455+ < p className = "text-muted-foreground text-sm mb-2" > { avatarData . role } </ p >
456+ < p className = "text-muted-foreground text-sm" > { avatarData . organizationDescription } </ p >
416457 </ div >
417458 </ div >
418459
419- < div className = "space-y-4" >
420- < div >
421- < h4 className = "font-medium text-foreground mb-3" > Expertise</ h4 >
422- < div className = "flex flex-wrap gap-2" >
423- { avatarData . keywords . filter ( k => k . trim ( ) ) . map ( ( keyword , index ) => (
424- < span
425- key = { index }
426- className = "px-3 py-1 bg-accent/10 text-accent rounded-full text-sm font-medium"
427- >
428- { keyword }
429- </ span >
430- ) ) }
431- </ div >
432- </ div >
433-
434- < div className = "pt-4 border-t border-border/50" >
435- < div className = "flex items-center justify-between" >
436- < div >
437- < h4 className = "font-medium text-foreground mb-2" > Design Style</ h4 >
438- < div className = "flex items-center space-x-3" >
439- < div className = "flex space-x-1" >
440- < div
441- className = "w-4 h-4 rounded-full"
442- style = { { backgroundColor : avatarData . primaryColor } }
443- />
444- < div
445- className = "w-4 h-4 rounded-full"
446- style = { { backgroundColor : avatarData . secondaryColor } }
447- />
448- </ div >
449- < span className = "text-sm text-muted-foreground capitalize" >
450- { avatarData . workingStyle . replace ( '-' , ' ' ) } approach
451- </ span >
452- </ div >
453- </ div >
454- </ div >
460+ < div >
461+ < h4 className = "font-medium text-foreground mb-3" > Expertise</ h4 >
462+ < div className = "flex flex-wrap gap-2" >
463+ { avatarData . keywords . filter ( k => k . trim ( ) ) . map ( ( keyword , index ) => (
464+ < span
465+ key = { index }
466+ className = "px-3 py-1 bg-accent/10 text-accent rounded-full text-sm font-medium"
467+ >
468+ { keyword }
469+ </ span >
470+ ) ) }
455471 </ div >
456472 </ div >
457473 </ div >
0 commit comments