"use client"; import { useState } from "react"; const steps = ["Basic Info", "Family Info", "Professional", "Interests", "Privacy", "Review"]; const fieldsByStep: Record = { 0: [ { label: "Full Name" }, { label: "Email Address", type: "email" }, { label: "Phone Number" }, { label: "City" }, { label: "State", type: "select", options: ["select state", "Texas", "Oklahoma", "Arkansas", "Louisiana"] }, ], 1: [ { label: "Spouse Name" }, { label: "Number of Family Members" }, { label: "Children (ages)", full: true }, ], 2: [ { label: "Profession" }, { label: "Company" }, { label: "LinkedIn / Website", full: true }, ], 3: [{ label: "Your Interests", full: true, placeholder: "Community Service, Technology, Cricket…" }], 4: [ { label: "Profile Visibility", type: "select", options: ["Members Only", "Public", "Circles Only"] }, { label: "Contact Visibility", type: "select", options: ["Connections", "Hidden", "All Members"] }, ], 5: [{ label: "Anything else you'd like us to know?", full: true }], }; export default function MembershipForm() { const [step, setStep] = useState(0); const fields = fieldsByStep[step]; return (
{/* Steps */}
{steps.map((s, i) => ( ))}
{/* Fields */}

Step I {steps[step]}

{fields.map((f) => (
{f.type === "select" ? ( ) : ( )}
))}
); }