From 0c168ce5fc829962b1f0f6a21177012622a75c06 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 5 Aug 2025 22:49:01 +0000 Subject: [PATCH] Create experience component cgen-e3faa486fa3b43b5a34fa116a43edd2f --- client/components/onboarding/Experience.tsx | 221 ++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 client/components/onboarding/Experience.tsx diff --git a/client/components/onboarding/Experience.tsx b/client/components/onboarding/Experience.tsx new file mode 100644 index 00000000..88bec90d --- /dev/null +++ b/client/components/onboarding/Experience.tsx @@ -0,0 +1,221 @@ +import { OnboardingData } from "@/pages/Onboarding"; +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { Textarea } from "@/components/ui/textarea"; +import { Badge } from "@/components/ui/badge"; +import { ArrowLeft, ArrowRight, Plus, X } from "lucide-react"; +import { useState } from "react"; + +interface ExperienceProps { + data: OnboardingData; + updateData: (data: Partial) => void; + nextStep: () => void; + prevStep: () => void; +} + +const experienceLevels = [ + { id: 'beginner', label: 'Beginner', description: 'New to the field' }, + { id: 'intermediate', label: 'Intermediate', description: '1-3 years experience' }, + { id: 'advanced', label: 'Advanced', description: '3-7 years experience' }, + { id: 'expert', label: 'Expert', description: '7+ years experience' }, +]; + +const skillSuggestions = { + 'game-developer': [ + 'Unity', 'Unreal Engine', 'C#', 'C++', 'JavaScript', 'Python', 'Blender', '3D Modeling', + 'Game Design', 'Level Design', 'Animation', 'Shader Programming', 'Roblox Development' + ], + 'client': [ + 'Project Management', 'Business Strategy', 'Product Development', 'Marketing', + 'Team Leadership', 'Budget Management', 'Quality Assurance', 'User Experience' + ], + 'member': [ + 'Research', 'Innovation', 'Technology Trends', 'Community Building', 'Networking', + 'Content Creation', 'Documentation', 'Knowledge Sharing' + ], + 'customer': [ + 'Gaming', 'Technology Adoption', 'User Feedback', 'Beta Testing', 'Community Participation', + 'Content Consumption', 'Product Evaluation' + ] +}; + +export default function Experience({ data, updateData, nextStep, prevStep }: ExperienceProps) { + const [newSkill, setNewSkill] = useState(''); + + const handleLevelChange = (level: string) => { + updateData({ + experience: { + ...data.experience, + level + } + }); + }; + + const handleSkillAdd = (skill: string) => { + if (skill && !data.experience.skills.includes(skill)) { + updateData({ + experience: { + ...data.experience, + skills: [...data.experience.skills, skill] + } + }); + } + setNewSkill(''); + }; + + const handleSkillRemove = (skillToRemove: string) => { + updateData({ + experience: { + ...data.experience, + skills: data.experience.skills.filter(skill => skill !== skillToRemove) + } + }); + }; + + const handleProjectsChange = (projects: string) => { + updateData({ + experience: { + ...data.experience, + previousProjects: projects + } + }); + }; + + const isValid = data.experience.level && data.experience.skills.length > 0; + const suggestions = data.userType ? skillSuggestions[data.userType] || [] : []; + + return ( +
+
+

+ Help us understand your background and expertise +

+
+ +
+ {/* Experience Level */} +
+ +
+ {experienceLevels.map((level) => ( + + ))} +
+
+ + {/* Skills */} +
+ + + {/* Current Skills */} + {data.experience.skills.length > 0 && ( +
+ {data.experience.skills.map((skill) => ( + + {skill} + handleSkillRemove(skill)} + /> + + ))} +
+ )} + + {/* Add Custom Skill */} +
+ setNewSkill(e.target.value)} + placeholder="Add a skill..." + className="flex-1 px-3 py-2 text-sm rounded-md border border-border/50 bg-background/50 focus:border-aethex-400 focus:outline-none" + onKeyPress={(e) => e.key === 'Enter' && handleSkillAdd(newSkill)} + /> + +
+ + {/* Skill Suggestions */} + {suggestions.length > 0 && ( +
+ +
+ {suggestions + .filter(skill => !data.experience.skills.includes(skill)) + .slice(0, 8) + .map((skill) => ( + + ))} +
+
+ )} +
+ + {/* Previous Projects (optional for some user types) */} + {(data.userType === 'game-developer' || data.userType === 'client') && ( +
+ +