"use client"; import { Check, ChevronLeft, ChevronRight, Upload } from "lucide-react"; import { useState } from "react"; import { FileUpload, FileUploadTrigger } from "@/components/diceui/file-upload"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/lib/utils"; interface ProfileData { name: string; username: string; avatar?: string; bio?: string; email?: string; phone?: string; location?: string; website?: string; twitter?: string; linkedin?: string; } interface SettingsProfile6Props { defaultValues?: Partial; className?: string; } const steps = [ { id: 1, title: "اطلاعات پایه", description: "نام و عکس پروفایل" }, { id: 2, title: "اطلاعات تماس", description: "ایمیل و شماره تماس" }, { id: 3, title: "لینک‌های حرفه‌ای", description: "وب‌سایت و شبکه‌ها" }, { id: 4, title: "بازبینی", description: "تأیید نهایی" }, ]; const SettingsProfile6 = ({ defaultValues = { name: "", username: "", avatar: "", bio: "", email: "", phone: "", location: "", website: "", twitter: "", linkedin: "", }, className, }: SettingsProfile6Props) => { const [currentStep, setCurrentStep] = useState(1); const [avatarFiles, setAvatarFiles] = useState([]); const [formData, setFormData] = useState({ name: defaultValues.name || "", username: defaultValues.username || "", avatar: defaultValues.avatar || "", bio: defaultValues.bio || "", email: defaultValues.email || "", phone: defaultValues.phone || "", location: defaultValues.location || "", website: defaultValues.website || "", twitter: defaultValues.twitter || "", linkedin: defaultValues.linkedin || "", }); const updateField = (field: keyof ProfileData, value: string) => { setFormData((prev) => ({ ...prev, [field]: value })); }; const nextStep = () => setCurrentStep((prev) => Math.min(prev + 1, 4)); const prevStep = () => setCurrentStep((prev) => Math.max(prev - 1, 1)); const avatarPreview = avatarFiles.length > 0 ? URL.createObjectURL(avatarFiles[0]) : formData.avatar; const initials = formData.name ?.split(" ") .map((n) => n[0]) .join("") .toUpperCase(); return (
{/* Header */}

تکمیل پروفایل

پروفایل خود را کامل کنید تا همکاران راحت‌تر با شما هماهنگ شوند

{/* Progress Steps */}
{steps.map((step, index) => (
step.id ? "border-primary bg-primary text-primary-foreground" : currentStep === step.id ? "border-primary text-primary" : "border-muted text-muted-foreground", )} > {currentStep > step.id ? ( ) : ( step.id.toLocaleString("fa-IR") )}

= step.id ? "text-foreground" : "text-muted-foreground", )} > {step.title}

{step.description}

{index < steps.length - 1 && (
step.id ? "bg-primary" : "bg-muted", )} /> )}
))}
{/* Step Content */} {/* Step 1: Basic Info */} {currentStep === 1 && (
{initials || "?"}
updateField("name", e.target.value)} placeholder="مثال: سارا محمدی" />
@ updateField("username", e.target.value) } placeholder="sarah.m" />