All files / app/(dashboard)/designer/setup page.tsx

94.62% Statements 546/577
87.3% Branches 55/63
32.14% Functions 9/28
94.62% Lines 546/577

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 7031x                                                               1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x       104x 104x 104x 104x 104x 104x 104x   104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x   104x 104x   104x 22x   22x 22x 22x 22x 22x 1x 1x 1x   21x 21x 21x 21x 21x   22x 1x 1x 1x   20x 20x 20x 20x 20x   22x 1x 1x 1x   19x 22x   22x 104x   104x 17x 17x         17x 17x 17x 17x   104x                     104x 116x 116x 84x 116x 22x 116x 10x 116x   116x   116x 116x   104x 2x   2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x   2x   1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x   104x 20x 20x 20x 20x   104x 1x 1x 1x 1x   104x 104x 104x 104x 104x   104x 104x     104x 104x 416x 416x 416x 416x 52x 364x 104x 260x 416x   416x 52x   364x   416x 416x 416x 416x 416x   416x 416x 416x 312x 312x 312x 312x 312x   416x 104x 104x   104x 104x 104x 104x 104x 104x 104x 104x 104x   104x 74x 74x 74x 74x   74x 74x 74x 1036x 1036x 1036x 1036x   1036x 1036x   1036x 1036x 12x   1036x 74x 74x 74x 74x 74x 74x 74x 74x         74x 74x 74x 74x       74x 74x 74x 74x   74x 74x 74x   74x 74x 74x 1036x 1036x 1036x 1036x 1036x   1036x 1036x 74x 74x 74x   74x 74x 74x 74x 74x 74x 74x 74x 74x 74x 74x 74x 74x     104x 16x 16x 16x 16x   16x 16x 16x 224x 224x 224x 224x 224x   224x 224x 224x 16x 16x 16x 16x 16x 16x 16x 16x       16x 16x 16x 16x   16x 16x 16x 16x   16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x     104x 6x 6x 6x   6x 6x 6x 6x 6x 18x 18x 18x 18x 6x 12x 18x 18x             18x 18x 18x 18x 18x 18x 18x 18x 6x 6x 6x   6x 6x 6x 6x   6x 6x 6x 6x 6x 6x 6x   6x 6x 6x 6x   6x 6x 6x 6x 6x 6x 6x 6x 6x 6x     104x 8x 8x 8x   8x 8x 8x 8x 8x   8x 8x 8x 8x 8x 8x 8x   8x 8x 8x 8x 8x 64x 64x 64x 64x   64x 64x 64x   64x 64x 64x 8x 8x 8x     8x 8x 8x 8x 8x 8x 8x   8x 8x 8x 8x 8x 8x 8x 8x           8x 8x 8x 8x   8x 8x   8x 8x 8x 8x   8x 8x 8x 8x 8x 8x 8x 8x     8x 8x 8x   8x 8x 8x 8x 8x 8x 8x 8x   104x 104x   104x 104x 104x   104x   104x 96x   96x 96x   8x 8x 2x 2x   2x   6x 6x   6x   8x   104x 104x 104x 104x   104x  
'use client';
 
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import { motion, AnimatePresence } from 'framer-motion';
import {
  Palette,
  Wrench,
  Image as ImageIcon,
  IndianRupee,
  ChevronLeft,
  ChevronRight,
  Check,
  Loader2,
  Plus,
  Grid3X3,
  LayoutGrid,
  Play,
} from 'lucide-react';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Badge } from '@/components/ui/badge';
import { Switch } from '@/components/ui/switch';
import { Checkbox } from '@/components/ui/checkbox';
import { createClient } from '@/lib/supabase/client';
import { toast } from '@/hooks/use-toast';
 
const STEPS = [
  { id: 'specialty', title: 'Specialty', icon: Palette },
  { id: 'tools', title: 'Tools', icon: Wrench },
  { id: 'gallery', title: 'Gallery', icon: ImageIcon },
  { id: 'pricing', title: 'Pricing', icon: IndianRupee },
];
 
const DESIGN_SPECIALTIES = [
  'UI/UX Design',
  'Brand Identity',
  'Logo Design',
  'Web Design',
  'Mobile App Design',
  'Illustration',
  'Motion Graphics',
  'Product Design',
  'Packaging Design',
  'Print Design',
  'Social Media Design',
  'Icon Design',
  '3D Design',
  'Typography',
];
 
const DESIGN_TOOLS = [
  'Figma',
  'Adobe Photoshop',
  'Adobe Illustrator',
  'Adobe XD',
  'Sketch',
  'InVision',
  'Framer',
  'Canva',
  'After Effects',
  'Premiere Pro',
  'Blender',
  'Cinema 4D',
  'Procreate',
  'Principle',
];
 
const STYLE_TAGS = [
  'Minimalist',
  'Bold',
  'Modern',
  'Corporate',
  'Playful',
  'Elegant',
  'Vintage',
  'Futuristic',
  'Hand-drawn',
  'Geometric',
  'Organic',
  'Dark Mode',
  'Colorful',
  'Monochrome',
];
 
const PROJECT_TYPES = [
  { id: 'logos', label: 'Logo Design' },
  { id: 'websites', label: 'Website Design' },
  { id: 'mobile_apps', label: 'Mobile App UI' },
  { id: 'brand_identity', label: 'Brand Identity' },
  { id: 'marketing', label: 'Marketing Materials' },
  { id: 'social_media', label: 'Social Media' },
  { id: 'packaging', label: 'Packaging' },
  { id: 'illustration', label: 'Illustrations' },
];
 
const GALLERY_LAYOUTS = [
  { id: 'grid', label: 'Grid', icon: Grid3X3, description: 'Clean, uniform grid layout' },
  { id: 'masonry', label: 'Masonry', icon: LayoutGrid, description: 'Pinterest-style layout' },
  { id: 'slider', label: 'Slider', icon: Play, description: 'Horizontal scrolling gallery' },
];
 
const designerSetupSchema = z.object({
  designSpecialties: z.array(z.string()).min(1, 'Select at least one specialty'),
  tools: z.array(z.string()).min(1, 'Select at least one tool'),
  styleTags: z.array(z.string()),
  galleryLayout: z.enum(['grid', 'masonry', 'slider']),
  showProcess: z.boolean(),
  watermarkEnabled: z.boolean(),
  yearsExperience: z.number().min(0).max(50),
  acceptingProjects: z.boolean(),
  projectTypes: z.array(z.string()),
  startingPriceInr: z.number().min(0).optional(),
  hourlyRateInr: z.number().min(0).optional(),
  dribbbleUrl: z.string().url().optional().or(z.literal('')),
  behanceUrl: z.string().url().optional().or(z.literal('')),
  figmaCommunityUrl: z.string().url().optional().or(z.literal('')),
});
 
type DesignerSetupForm = z.infer<typeof designerSetupSchema>;
 
export default function DesignerSetupPage() {
  const [currentStep, setCurrentStep] = useState(0);
  const [loading, setLoading] = useState(false);
  const [profileId, setProfileId] = useState<string | null>(null);
  const [customSpecialty, setCustomSpecialty] = useState('');
  const [customTool, setCustomTool] = useState('');
  const router = useRouter();
 
  const form = useForm<DesignerSetupForm>({
    resolver: zodResolver(designerSetupSchema),
    defaultValues: {
      designSpecialties: [],
      tools: [],
      styleTags: [],
      galleryLayout: 'grid',
      showProcess: false,
      watermarkEnabled: false,
      yearsExperience: 0,
      acceptingProjects: true,
      projectTypes: [],
      startingPriceInr: undefined,
      hourlyRateInr: undefined,
      dribbbleUrl: '',
      behanceUrl: '',
      figmaCommunityUrl: '',
    },
  });
 
  const { watch, setValue, handleSubmit } = form;
  const formValues = watch();
 
  useEffect(() => {
    const supabase = createClient();
 
    async function checkProfile() {
      const {
        data: { user },
      } = await supabase.auth.getUser();
      if (!user) {
        router.push('/login');
        return;
      }
 
      const { data: profile } = await supabase
        .from('profiles')
        .select('id')
        .eq('user_id', user.id)
        .single();
 
      if (!profile) {
        router.push('/profile');
        return;
      }
 
      const { data: existingDesigner } = await supabase
        .from('designer_profiles')
        .select('id')
        .eq('profile_id', profile.id)
        .single();
 
      if (existingDesigner) {
        router.push('/designer');
        return;
      }
 
      setProfileId(profile.id);
    }
 
    checkProfile();
  }, [router]);
 
  const toggleItem = (field: keyof DesignerSetupForm, item: string) => {
    const current = formValues[field] as string[];
    if (current.includes(item)) {
      setValue(
        field,
        current.filter((i) => i !== item)
      );
    } else {
      setValue(field, [...current, item]);
    }
  };
 
  const addCustomItem = (
    field: keyof DesignerSetupForm,
    value: string,
    setter: (v: string) => void
  ) => {
    if (value.trim() && !(formValues[field] as string[]).includes(value.trim())) {
      setValue(field, [...(formValues[field] as string[]), value.trim()]);
      setter('');
    }
  };
 
  const canProceed = () => {
    switch (currentStep) {
      case 0:
        return formValues.designSpecialties.length > 0;
      case 1:
        return formValues.tools.length > 0;
      case 2:
        return true;
      case 3:
        return true;
      default:
        return false;
    }
  };
 
  const onSubmit = async (data: DesignerSetupForm) => {
    if (!profileId) return;
 
    setLoading(true);
    const supabase = createClient();
    try {
      const { error } = await supabase.from('designer_profiles').insert({
        profile_id: profileId,
        design_specialties: data.designSpecialties,
        tools: data.tools,
        style_tags: data.styleTags,
        gallery_layout: data.galleryLayout,
        show_process: data.showProcess,
        watermark_enabled: data.watermarkEnabled,
        years_experience: data.yearsExperience,
        accepting_projects: data.acceptingProjects,
        project_types: data.projectTypes,
        starting_price_inr: data.startingPriceInr ? data.startingPriceInr * 100 : null,
        hourly_rate_inr: data.hourlyRateInr ? data.hourlyRateInr * 100 : null,
        dribbble_url: data.dribbbleUrl || null,
        behance_url: data.behanceUrl || null,
        figma_community_url: data.figmaCommunityUrl || null,
      });
 
      if (error) throw error;
 
      await supabase.from('profiles').update({ profile_type: 'designer' }).eq('id', profileId);
 
      toast({ title: 'Success', description: 'Designer profile created successfully!' });
      router.refresh(); // Refresh to update navigation and sidebar state
      router.push('/designer');
    } catch (error) {
      console.error('Error creating designer profile:', error);
      toast({
        title: 'Error',
        description: 'Failed to create designer profile',
        variant: 'destructive',
      });
    } finally {
      setLoading(false);
    }
  };
 
  const nextStep = () => {
    if (currentStep < STEPS.length - 1 && canProceed()) {
      setCurrentStep(currentStep + 1);
    }
  };
 
  const prevStep = () => {
    if (currentStep > 0) {
      setCurrentStep(currentStep - 1);
    }
  };
 
  return (
    <div className="mx-auto max-w-3xl space-y-8">
      <div>
        <h1 className="text-3xl font-bold">Set Up Your Designer Profile</h1>
        <p className="text-muted-foreground">
          Create a stunning visual portfolio to showcase your work
        </p>
      </div>
 
      {/* Progress Steps */}
      <div className="flex items-center justify-between">
        {STEPS.map((step, index) => (
          <div key={step.id} className="flex items-center">
            <div
              className={`flex h-10 w-10 items-center justify-center rounded-full border-2 transition-colors ${
                index < currentStep
                  ? 'border-primary bg-primary text-primary-foreground'
                  : index === currentStep
                    ? 'border-primary text-primary'
                    : 'border-muted text-muted-foreground'
              }`}
            >
              {index < currentStep ? (
                <Check className="h-5 w-5" />
              ) : (
                <step.icon className="h-5 w-5" />
              )}
            </div>
            <span
              className={`ml-2 hidden text-sm font-medium sm:block ${
                index <= currentStep ? 'text-foreground' : 'text-muted-foreground'
              }`}
            >
              {step.title}
            </span>
            {index < STEPS.length - 1 && (
              <div
                className={`mx-2 h-0.5 w-12 sm:mx-4 sm:w-24 ${
                  index < currentStep ? 'bg-primary' : 'bg-muted'
                }`}
              />
            )}
          </div>
        ))}
      </div>
 
      <Card>
        <CardContent className="pt-6">
          <AnimatePresence mode="wait">
            <motion.div
              key={currentStep}
              initial={{ opacity: 0, x: 20 }}
              animate={{ opacity: 1, x: 0 }}
              exit={{ opacity: 0, x: -20 }}
              transition={{ duration: 0.2 }}
            >
              {currentStep === 0 && (
                <div className="space-y-6">
                  <div>
                    <h2 className="mb-2 text-xl font-semibold">Design Specialties</h2>
                    <p className="mb-4 text-sm text-muted-foreground">
                      What type of design work do you specialize in?
                    </p>
                    <div className="mb-4 flex flex-wrap gap-2">
                      {DESIGN_SPECIALTIES.map((specialty) => (
                        <Badge
                          key={specialty}
                          variant={
                            formValues.designSpecialties.includes(specialty) ? 'default' : 'outline'
                          }
                          className="cursor-pointer transition-colors hover:bg-primary/90"
                          onClick={() => toggleItem('designSpecialties', specialty)}
                        >
                          {specialty}
                          {formValues.designSpecialties.includes(specialty) && (
                            <Check className="ml-1 h-3 w-3" />
                          )}
                        </Badge>
                      ))}
                    </div>
                    <div className="flex gap-2">
                      <Input
                        placeholder="Add custom specialty..."
                        value={customSpecialty}
                        onChange={(e) => setCustomSpecialty(e.target.value)}
                        onKeyDown={(e) =>
                          e.key === 'Enter' &&
                          (e.preventDefault(),
                          addCustomItem('designSpecialties', customSpecialty, setCustomSpecialty))
                        }
                      />
                      <Button
                        variant="outline"
                        onClick={() =>
                          addCustomItem('designSpecialties', customSpecialty, setCustomSpecialty)
                        }
                      >
                        <Plus className="h-4 w-4" />
                      </Button>
                    </div>
                  </div>
 
                  <div>
                    <h2 className="mb-2 text-xl font-semibold">Style Tags</h2>
                    <p className="mb-4 text-sm text-muted-foreground">
                      Describe your design aesthetic
                    </p>
                    <div className="flex flex-wrap gap-2">
                      {STYLE_TAGS.map((tag) => (
                        <Badge
                          key={tag}
                          variant={formValues.styleTags.includes(tag) ? 'default' : 'outline'}
                          className="cursor-pointer transition-colors hover:bg-primary/90"
                          onClick={() => toggleItem('styleTags', tag)}
                        >
                          {tag}
                        </Badge>
                      ))}
                    </div>
                  </div>
 
                  <div>
                    <Label htmlFor="yearsExperience">Years of Experience</Label>
                    <Input
                      id="yearsExperience"
                      type="number"
                      min={0}
                      max={50}
                      value={formValues.yearsExperience}
                      onChange={(e) => setValue('yearsExperience', parseInt(e.target.value) || 0)}
                      className="mt-1"
                    />
                  </div>
                </div>
              )}
 
              {currentStep === 1 && (
                <div className="space-y-6">
                  <div>
                    <h2 className="mb-2 text-xl font-semibold">Design Tools</h2>
                    <p className="mb-4 text-sm text-muted-foreground">
                      What tools do you use for your design work?
                    </p>
                    <div className="mb-4 flex flex-wrap gap-2">
                      {DESIGN_TOOLS.map((tool) => (
                        <Badge
                          key={tool}
                          variant={formValues.tools.includes(tool) ? 'default' : 'outline'}
                          className="cursor-pointer transition-colors hover:bg-primary/90"
                          onClick={() => toggleItem('tools', tool)}
                        >
                          {tool}
                          {formValues.tools.includes(tool) && <Check className="ml-1 h-3 w-3" />}
                        </Badge>
                      ))}
                    </div>
                    <div className="flex gap-2">
                      <Input
                        placeholder="Add custom tool..."
                        value={customTool}
                        onChange={(e) => setCustomTool(e.target.value)}
                        onKeyDown={(e) =>
                          e.key === 'Enter' &&
                          (e.preventDefault(), addCustomItem('tools', customTool, setCustomTool))
                        }
                      />
                      <Button
                        variant="outline"
                        onClick={() => addCustomItem('tools', customTool, setCustomTool)}
                      >
                        <Plus className="h-4 w-4" />
                      </Button>
                    </div>
                  </div>
 
                  <div className="border-t pt-6">
                    <h3 className="mb-4 font-medium">External Portfolios (Optional)</h3>
                    <div className="space-y-4">
                      <div>
                        <Label htmlFor="dribbble">Dribbble URL</Label>
                        <Input
                          id="dribbble"
                          placeholder="https://dribbble.com/username"
                          value={formValues.dribbbleUrl}
                          onChange={(e) => setValue('dribbbleUrl', e.target.value)}
                          className="mt-1"
                        />
                      </div>
                      <div>
                        <Label htmlFor="behance">Behance URL</Label>
                        <Input
                          id="behance"
                          placeholder="https://behance.net/username"
                          value={formValues.behanceUrl}
                          onChange={(e) => setValue('behanceUrl', e.target.value)}
                          className="mt-1"
                        />
                      </div>
                      <div>
                        <Label htmlFor="figma">Figma Community URL</Label>
                        <Input
                          id="figma"
                          placeholder="https://figma.com/@username"
                          value={formValues.figmaCommunityUrl}
                          onChange={(e) => setValue('figmaCommunityUrl', e.target.value)}
                          className="mt-1"
                        />
                      </div>
                    </div>
                  </div>
                </div>
              )}
 
              {currentStep === 2 && (
                <div className="space-y-6">
                  <div>
                    <h2 className="mb-4 text-xl font-semibold">Gallery Settings</h2>
 
                    <div className="space-y-4">
                      <div>
                        <Label>Gallery Layout</Label>
                        <div className="mt-2 grid grid-cols-3 gap-3">
                          {GALLERY_LAYOUTS.map((layout) => (
                            <div
                              key={layout.id}
                              className={`flex cursor-pointer flex-col items-center gap-2 rounded-lg border p-4 transition-colors ${
                                formValues.galleryLayout === layout.id
                                  ? 'border-primary bg-primary/5'
                                  : 'hover:bg-muted'
                              }`}
                              onClick={() =>
                                setValue(
                                  'galleryLayout',
                                  layout.id as 'grid' | 'masonry' | 'slider'
                                )
                              }
                            >
                              <layout.icon
                                className={`h-8 w-8 ${formValues.galleryLayout === layout.id ? 'text-primary' : 'text-muted-foreground'}`}
                              />
                              <p className="text-sm font-medium">{layout.label}</p>
                              <p className="text-center text-xs text-muted-foreground">
                                {layout.description}
                              </p>
                            </div>
                          ))}
                        </div>
                      </div>
 
                      <div className="flex items-center justify-between rounded-lg border p-4">
                        <div>
                          <p className="font-medium">Show Design Process</p>
                          <p className="text-sm text-muted-foreground">
                            Display process images with your work
                          </p>
                        </div>
                        <Switch
                          checked={formValues.showProcess}
                          onCheckedChange={(checked) => setValue('showProcess', checked)}
                        />
                      </div>
 
                      <div className="flex items-center justify-between rounded-lg border p-4">
                        <div>
                          <p className="font-medium">Watermark Images</p>
                          <p className="text-sm text-muted-foreground">
                            Add a watermark to protect your work
                          </p>
                        </div>
                        <Switch
                          checked={formValues.watermarkEnabled}
                          onCheckedChange={(checked) => setValue('watermarkEnabled', checked)}
                        />
                      </div>
                    </div>
                  </div>
                </div>
              )}
 
              {currentStep === 3 && (
                <div className="space-y-6">
                  <div>
                    <h2 className="mb-4 text-xl font-semibold">Availability & Pricing</h2>
 
                    <div className="space-y-4">
                      <div className="flex items-center justify-between rounded-lg border p-4">
                        <div>
                          <p className="font-medium">Accepting Projects</p>
                          <p className="text-sm text-muted-foreground">
                            Show that you are available for new work
                          </p>
                        </div>
                        <Switch
                          checked={formValues.acceptingProjects}
                          onCheckedChange={(checked) => setValue('acceptingProjects', checked)}
                        />
                      </div>
 
                      {formValues.acceptingProjects && (
                        <div>
                          <Label>Project Types</Label>
                          <div className="mt-2 grid grid-cols-2 gap-2">
                            {PROJECT_TYPES.map((type) => (
                              <div
                                key={type.id}
                                className={`flex cursor-pointer items-center gap-2 rounded-lg border p-3 transition-colors ${
                                  formValues.projectTypes.includes(type.id)
                                    ? 'border-primary bg-primary/5'
                                    : 'hover:bg-muted'
                                }`}
                                onClick={() => toggleItem('projectTypes', type.id)}
                              >
                                <Checkbox checked={formValues.projectTypes.includes(type.id)} />
                                <span className="text-sm">{type.label}</span>
                              </div>
                            ))}
                          </div>
                        </div>
                      )}
 
                      <div className="border-t pt-6">
                        <h3 className="mb-4 font-medium">Pricing (Optional)</h3>
                        <div className="grid gap-4 sm:grid-cols-2">
                          <div>
                            <Label htmlFor="startingPrice">Starting Price (INR)</Label>
                            <div className="relative mt-1">
                              <span className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground">
                                ₹
                              </span>
                              <Input
                                id="startingPrice"
                                type="number"
                                min={0}
                                placeholder="e.g., 5000"
                                value={formValues.startingPriceInr || ''}
                                onChange={(e) =>
                                  setValue(
                                    'startingPriceInr',
                                    parseInt(e.target.value) || undefined
                                  )
                                }
                                className="pl-8"
                              />
                            </div>
                            <p className="mt-1 text-xs text-muted-foreground">
                              Minimum project price
                            </p>
                          </div>
 
                          <div>
                            <Label htmlFor="hourlyRate">Hourly Rate (INR)</Label>
                            <div className="relative mt-1">
                              <span className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground">
                                ₹
                              </span>
                              <Input
                                id="hourlyRate"
                                type="number"
                                min={0}
                                placeholder="e.g., 1000"
                                value={formValues.hourlyRateInr || ''}
                                onChange={(e) =>
                                  setValue('hourlyRateInr', parseInt(e.target.value) || undefined)
                                }
                                className="pl-8"
                              />
                              <span className="absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground">
                                /hr
                              </span>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              )}
            </motion.div>
          </AnimatePresence>
 
          <div className="mt-8 flex justify-between border-t pt-6">
            <Button variant="outline" onClick={prevStep} disabled={currentStep === 0}>
              <ChevronLeft className="mr-2 h-4 w-4" />
              Back
            </Button>
 
            {currentStep < STEPS.length - 1 ? (
              <Button onClick={nextStep} disabled={!canProceed()}>
                Next
                <ChevronRight className="ml-2 h-4 w-4" />
              </Button>
            ) : (
              <Button onClick={handleSubmit(onSubmit)} disabled={loading}>
                {loading ? (
                  <>
                    <Loader2 className="mr-2 h-4 w-4 animate-spin" />
                    Creating...
                  </>
                ) : (
                  <>
                    <Check className="mr-2 h-4 w-4" />
                    Create Designer Profile
                  </>
                )}
              </Button>
            )}
          </div>
        </CardContent>
      </Card>
    </div>
  );
}