import { Card } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; import { useState, useMemo } from "react"; import { ChevronRight, Zap, Users, Code } from "lucide-react"; interface CreatorProfileProps { data: any; updateData: (data: any) => void; nextStep: () => void; prevStep: () => void; currentStep: number; totalSteps: number; } const AVAILABLE_ARMS = [ { id: "labs", name: "Labs", description: "R&D & Innovation", color: "from-yellow-500 to-orange-500", icon: Zap, }, { id: "gameforge", name: "GameForge", description: "Game Development", color: "from-green-500 to-emerald-500", icon: Code, }, { id: "corp", name: "Corp", description: "Enterprise Consulting", color: "from-blue-500 to-cyan-500", icon: Users, }, { id: "foundation", name: "Foundation", description: "Education & Open Source", color: "from-red-500 to-pink-500", icon: Users, }, ]; const SKILL_SUGGESTIONS = [ "Game Development", "Web Development", "Backend Development", "Machine Learning", "UI/UX Design", "DevOps", "Mobile Development", "Data Science", "Cloud Architecture", "3D Modeling", "Audio Engineering", "Project Management", "Community Building", "Technical Writing", "Open Source", ]; export default function CreatorProfile({ data, updateData, nextStep, prevStep, currentStep, totalSteps, }: CreatorProfileProps) { const [inputValue, setInputValue] = useState(""); const creatorData = { bio: data?.creatorProfile?.bio || "", skills: Array.isArray(data?.creatorProfile?.skills) ? data.creatorProfile.skills : [], primaryArm: data?.creatorProfile?.primaryArm || "", }; const canProceed = useMemo(() => { const hasUsername = data?.username && typeof data.username === "string" && data.username.trim().length > 0; const hasPrimaryArm = creatorData.primaryArm; const hasSkills = creatorData.skills.length > 0; return hasUsername && hasPrimaryArm && hasSkills; }, [data?.username, creatorData.primaryArm, creatorData.skills.length]); const handleAddSkill = (skill: string) => { if (!creatorData.skills.includes(skill)) { updateData({ creatorProfile: { ...creatorData, skills: [...creatorData.skills, skill], }, }); } setInputValue(""); }; const handleRemoveSkill = (skill: string) => { updateData({ creatorProfile: { ...creatorData, skills: creatorData.skills.filter((s) => s !== skill), }, }); }; const handleSelectArm = (armId: string) => { updateData({ creatorProfile: { ...creatorData, primaryArm: armId, }, }); }; const handleBioChange = (bio: string) => { updateData({ creatorProfile: { ...creatorData, bio, }, }); }; return (
{/* Username Section */}
@ { const cleanedUsername = e.target.value .toLowerCase() .replace(/[^a-z0-9_-]/g, "") .replace(/^-+|-+$/g, ""); updateData({ username: cleanedUsername }); }} placeholder="your-creator-name" maxLength={32} className="pl-7 bg-gray-900/50 border-gray-700" />

{(data?.username || "").length}/32 characters. Lowercase letters, numbers, hyphens, and underscores only.

{(data?.username?.length || 0) === 0 && (

Username is required

)}
{/* Bio Section */}