"use client"; import { Check, ChevronRight, Plus } from "lucide-react"; import { motion } from "motion/react"; import React, { useRef, useState } from "react"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/lib/utils"; const toFaDigits = (value: number) => value.toLocaleString("fa-IR"); interface Hyperlink { label: string; href: string; } interface StepComponentProps { onSubmit: () => void; goBack?: () => void; currentStep: number; totalSteps: number; } interface OnboardingStep { component: React.ComponentType; } interface OnboardingStepHeaderProps { title: string; stepIndex: number; totalSteps: number; goBack?: () => void; } const OnboardingStepHeader = ({ title, stepIndex, totalSteps, goBack, }: OnboardingStepHeaderProps) => { return (
{goBack && stepIndex > 0 && ( )}

{toFaDigits(stepIndex + 1)}/{toFaDigits(totalSteps)}

{title}

); }; interface OnboardingStepProps { children: React.ReactNode; } const OnboardingStep = ({ children }: OnboardingStepProps) => { return (
{children}
); }; interface OnboardingStepLeftWrapperProps { title: string; currentStep: number; totalSteps: number; children: React.ReactNode; goBack?: () => void; } const OnboardingStepLeftWrapper = ({ title, currentStep, totalSteps, goBack, children, }: OnboardingStepLeftWrapperProps) => { return (
{children}
); }; interface OnboardingStepRightWrapperProps { children: React.ReactNode; className?: string; } const OnboardingStepRightWrapper = ({ children, className, }: OnboardingStepRightWrapperProps) => { return (
{children}
); }; interface FileInputProps { label: string; name: string; onChange: (e: React.ChangeEvent) => void; onRemove: () => void; value: string | null; description?: string; } const FileInput = ({ label, name, onChange, onRemove, value, description, }: FileInputProps) => { const fileInputRef = useRef(null); const handleUploadFile = () => { fileInputRef.current?.click(); }; return (
{value ? ( تصویر پروفایل ) : ( )}
{value && ( )}

{description}

); }; interface DashboardIllustrationProps { image?: string | null; variant?: "zoomed-in" | "zoomed-out"; title?: string; transformOrigin?: string; className?: string; } const DashboardIllustration = ({ image, variant = "zoomed-out", title = "عنوان فضای کار", transformOrigin = "-20% -10%", className, }: DashboardIllustrationProps) => { return (
{image && ( تصویر فضای کار )}

{title}

    {Array.from({ length: 10 }).map((_, index) => (
  • ))}
{Array.from({ length: 2 }).map((_, index) => (
))}
{[10, 40, 30, 60].map((width, index) => ( ))} {Array.from({ length: 8 }).map((_, rowIndex) => ( {Array.from({ length: 4 }).map((_, colIndex) => ( ))} ))}
{Array.from({ length: 5 }).map((_, index) => (
))}
); }; interface FormFieldProps { label: string; placeholder: string; name: string; type?: string; input?: string; onChange?: React.ChangeEventHandler; options?: { label: string; value: string }[]; } const FormField = ({ label, placeholder, name, type, input = "input", onChange, options, }: FormFieldProps) => { return (
{input === "textarea" && (