'use client'; import { useState, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Image from 'next/image'; import { QuickLinks, FormSection, FormInput, FormCheckbox, FormTextarea, FormSelect, FileUpload, AttachedFile, TagInput, } from './components'; // Initial form data - in production this would come from API const initialFormData = { firstName: 'Brian', lastName: 'Neeland', email: 'brian@requestnetwork.com', phone: '+9195003837493', professionalTypes: { firstTime: true, solo: false, team: false, }, attachedDocuments: ['Brian_Photo_1_Blue_Coat.pdf'], state: 'Colorado', licensedAreas: ['Colorado Springs', 'Monument'], expertiseYears: [ { area: 'Colorado', years: '10 yrs' }, { area: 'Falcon', years: '10 yrs' }, ], biography: "Brian brings eight years of hands-on experience helping clients confidently buy, sell, and invest in real estate. He combines strong analytical skills with deep market knowledge to identify the right opportunities and guide clients through every step of the process. With a data-driven approach and clear communication, Brian ensures smooth transactions and informed decisions tailored to each client's goals.", testimonialHighlight: "The most amazing experience I've had as a real estate professional is helping a family secure their dream home and seeing their happiness when they received the keys.", expertise: ['Buyers', 'Sellers', 'Divorce', 'Luxury', 'Retirement', 'Historical', 'Condo', 'Rural'], yearsInBusiness: { totalYears: '10 Years', totalTransactions: '100+', }, contractsClosed: { lessThan10: false, between10And25: false, between26And50: true, between51And75: false, moreThan75: false, }, pricePoint: { under100k: false, between100kAnd200k: false, between200kAnd400k: true, between400kAnd600k: true, between600kAnd800k: false, between800kAnd1m: false, above1m: false, }, specialization: { clientLocalization: { local: true, national: false, international: false, }, clientTypeWorkedWith: { firstTimeBuyer: true, firstTimeSeller: false, }, propertyType: { sfr: true, condo: false, luxury: false, townhome: false, commercial: false, }, transactionType: { relocation: true, probate: false, taxLien: false, traditional: false, newConstruction: false, }, loanType: { conventional: true, fha: false, va: false, usda: false, reverse: false, }, lifestyleSpecialties: { boating: true, horses: false, rv: false, automotive: false, aviation: false, }, }, hobbies: ['Boating', 'Horses'], certifications: [ { name: 'Certified Residential Specialist (CRS)', org: 'Residential Real Estate Council' }, ], availability: { type: 'Full Time Weekend', workFrom: 'Work from Method', }, }; export default function EditProfilePage() { const router = useRouter(); const [formData, setFormData] = useState(initialFormData); const scrollContainerRef = useRef(null); const [stateInput, setStateInput] = useState(''); const handleCancel = () => { router.push('/agent/dashboard'); }; const handleSave = () => { // In production, this would save to API console.log('Saving form data:', formData); router.push('/agent/dashboard'); }; const updateField = (field: string, value: any) => { setFormData((prev) => ({ ...prev, [field]: value })); }; const handleAddLicensedArea = (value: string) => { const trimmedValue = value.trim(); if (trimmedValue && !formData.licensedAreas.includes(trimmedValue)) { updateField('licensedAreas', [...formData.licensedAreas, trimmedValue]); } setStateInput(''); }; const handleStateInputKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ',') { e.preventDefault(); handleAddLicensedArea(stateInput); } }; return (
{/* Left Sidebar - Quick Links */}
{/* Main Content - Scrollable */}
{/* Basic Information */}
updateField('firstName', value)} placeholder="Enter first name" /> updateField('lastName', value)} placeholder="Enter last name" />
{/* Contact Information */}
updateField('email', value)} placeholder="Enter email" type="email" /> updateField('phone', value)} placeholder="Enter phone" type="tel" />
{/* Professional Types */}
updateField('professionalTypes', { ...formData.professionalTypes, firstTime: checked }) } /> updateField('professionalTypes', { ...formData.professionalTypes, solo: checked }) } /> updateField('professionalTypes', { ...formData.professionalTypes, team: checked }) } />
{/* Upload Documents */}
console.log('Files selected:', files)} /> {/* Attached Documents */} {formData.attachedDocuments.length > 0 && (

Attached Attached Documents

{formData.attachedDocuments.map((doc, idx) => ( { const newDocs = [...formData.attachedDocuments]; newDocs.splice(idx, 1); updateField('attachedDocuments', newDocs); }} /> ))}
)}
{/* Licensing & Areas */}
Location
setStateInput(e.target.value)} onKeyDown={handleStateInputKeyDown} placeholder="Enter state" className="w-full h-[40px] pl-10 pr-4 border border-[#00293D]/20 rounded-[15px] text-[14px] font-serif text-[#00293D] placeholder:text-[#00293D]/40 focus:outline-none focus:border-[#E58625]" />

Press Enter or comma to add a state.

{formData.licensedAreas.map((area) => ( {area} ))}
{/* Biography */}
updateField('biography', value)} placeholder="Write your biography..." rows={5} maxLength={500} /> updateField('testimonialHighlight', value)} placeholder="Write your memorable experience..." rows={3} maxLength={250} />
{/* Expertise */}
updateField('expertise', tags)} placeholder="Add expertise..." />
{/* Years In Business */}
updateField('yearsInBusiness', { ...formData.yearsInBusiness, totalYears: value }) } /> updateField('yearsInBusiness', { ...formData.yearsInBusiness, totalTransactions: value }) } />
{/* Areas in expertise & Years */}
console.log('Edit areas')} >
updateField('state', value)} options={[ { value: 'Colorado', label: 'Colorado' }, { value: 'Texas', label: 'Texas' }, ]} /> {}} options={[ { value: '5', label: '5 Years' }, { value: '10', label: '10 Years' }, { value: '15', label: '15 Years' }, ]} />
{/* Contracts Closed */}
updateField('contractsClosed', { ...formData.contractsClosed, lessThan10: checked }) } /> updateField('contractsClosed', { ...formData.contractsClosed, between10And25: checked }) } /> updateField('contractsClosed', { ...formData.contractsClosed, between26And50: checked }) } /> updateField('contractsClosed', { ...formData.contractsClosed, between51And75: checked }) } /> updateField('contractsClosed', { ...formData.contractsClosed, moreThan75: checked }) } />
{/* Price Point */}
updateField('pricePoint', { ...formData.pricePoint, under100k: checked }) } /> updateField('pricePoint', { ...formData.pricePoint, between100kAnd200k: checked }) } /> updateField('pricePoint', { ...formData.pricePoint, between200kAnd400k: checked }) } /> updateField('pricePoint', { ...formData.pricePoint, between400kAnd600k: checked }) } /> updateField('pricePoint', { ...formData.pricePoint, between600kAnd800k: checked }) } /> updateField('pricePoint', { ...formData.pricePoint, between800kAnd1m: checked }) } /> updateField('pricePoint', { ...formData.pricePoint, above1m: checked }) } />
{/* Specialization */}
{/* Client Localization */}

Client Localization

{}} /> {}} /> {}} />
{/* Client Type Worked With */}

Client Type Worked With

{}} /> {}} />
{/* Property Type */}

Property Type

{}} /> {}} /> {}} /> {}} /> {}} />
{/* Transaction Type */}

Transaction Type

{}} /> {}} /> {}} /> {}} /> {}} />
{/* Loan Type */}

Loan Type

{}} /> {}} /> {}} /> {}} /> {}} />
{/* Lifestyle Specialties */}

Lifestyle Specialties

{}} /> {}} /> {}} /> {}} /> {}} />
{/* Special Interests & Hobbies */}
updateField('hobbies', tags)} placeholder="Add hobby..." />
{/* Certifications */}

Certifications / Designations

{formData.certifications.map((cert, idx) => (

{cert.name}

{cert.org}

))}
{/* Availability */}
updateField('availability', { ...formData.availability, type: value }) } options={[ { value: 'Full Time Weekend', label: 'Full Time Weekend' }, { value: 'Part Time', label: 'Part Time' }, { value: 'Weekdays Only', label: 'Weekdays Only' }, ]} /> updateField('availability', { ...formData.availability, workFrom: value }) } options={[ { value: 'Work from Method', label: 'Work from Method' }, { value: 'Remote', label: 'Remote' }, { value: 'In Office', label: 'In Office' }, { value: 'Hybrid', label: 'Hybrid' }, ]} />
{/* Action Buttons */}
); }