'use client'; import { useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Image from 'next/image'; import Link from 'next/link'; import { FilterModal, FilterState, clientSpecializations, loanTypes, propertyTypes, pricePoints } from '@/components/profiles/FilterModal'; // Sample profile data const profilesData = [ { id: '1', name: 'Brian Noseland', verified: true, title: 'Licensed Real Estate Agent', location: 'Colorado', memberSince: 'March 2020', bio: 'Brian has eight years of experience helping clients buy, sell, and invest in properties. He combines strong analytical skills with market insight to deliver smooth, data-driven real estate transactions.', expertise: ['Buyers', 'Sellers', 'Divorce', 'Luxury', 'Retirement', 'Historical', 'condo', 'Rural'], certifications: ['FHA', 'Conventional', 'USDA'], matchPercentage: 95, imageUrl: '/assets/images/professional-1.jpg', }, { id: '2', name: 'Brian Noseland', verified: true, title: 'Licensed Real Estate Agent', location: 'Colorado', memberSince: 'March 2020', bio: 'Brian has eight years of experience helping clients buy, sell, and invest in properties. He combines strong analytical skills with market insight to deliver smooth, data-driven real estate transactions.', expertise: ['Buyers', 'Sellers', 'Divorce', 'Luxury', 'Retirement', 'Historical', 'condo'], certifications: ['FHA', 'Conventional', 'USDA'], matchPercentage: 95, imageUrl: '/assets/images/professional-2.jpg', }, { id: '3', name: 'Brian Noseland', verified: true, title: 'Licensed Real Estate Agent', location: 'Colorado', memberSince: 'March 2020', bio: 'Brian has eight years of experience helping clients buy, sell, and invest in properties. He combines strong analytical skills with market insight to deliver smooth, data-driven real estate transactions.', expertise: ['Buyers', 'Sellers', 'Divorce', 'Luxury', 'Retirement', 'Historical', 'condo', 'Rural'], certifications: ['FHA', 'Conventional', 'USDA'], matchPercentage: 95, imageUrl: '/assets/images/professional-3.jpg', }, { id: '4', name: 'Brian Noseland', verified: true, title: 'Licensed Real Estate Agent', location: 'Colorado', memberSince: 'March 2020', bio: 'Brian has eight years of experience helping clients buy, sell, and invest in properties. He combines strong analytical skills with market insight to deliver smooth, data-driven real estate transactions.', expertise: ['Buyers', 'Sellers', 'Divorce', 'Luxury', 'Retirement', 'Historical', 'condo', 'Rural'], certifications: ['FHA', 'Conventional', 'USDA'], matchPercentage: 95, imageUrl: '/assets/images/professional-1.jpg', }, { id: '5', name: 'Brian Noseland', verified: true, title: 'Licensed Real Estate Agent', location: 'Colorado', memberSince: 'March 2020', bio: 'Brian has eight years of experience helping clients buy, sell, and invest in properties. He combines strong analytical skills with market insight to deliver smooth, data-driven real estate transactions.', expertise: ['Buyers', 'Sellers', 'Divorce', 'Luxury', 'Retirement', 'Historical', 'condo', 'Rural'], certifications: ['FHA', 'Conventional', 'USDA'], matchPercentage: 95, imageUrl: '/assets/images/professional-2.jpg', }, ]; const categoryTabs = [ { id: 'residential', label: 'Residential' }, { id: 'analytics', label: 'Analytics' }, { id: 'commercial', label: 'Commercial' }, { id: 'property', label: 'Property' }, ]; interface FilterSectionProps { title: string; options: string[]; selectedOptions: string[]; onToggle: (option: string) => void; showMore?: boolean; } function FilterSection({ title, options, selectedOptions, onToggle, showMore }: FilterSectionProps) { const [expanded, setExpanded] = useState(false); const displayOptions = expanded ? options : options.slice(0, 6); return (

{title}

{displayOptions.map((option) => ( ))}
{showMore && options.length > 6 && ( )}
); } interface ProfileCardProps { profile: typeof profilesData[0]; } function ProfileCard({ profile }: ProfileCardProps) { const [showFullBio, setShowFullBio] = useState(false); const truncatedBio = profile.bio.length > 150 ? profile.bio.slice(0, 150) + '...' : profile.bio; return (
{/* Profile Image */}
{profile.name}
{/* Profile Info */}
{/* Header */}

{profile.name}

{profile.verified && ( Verified (Verified Expert) )}

{profile.title}

{profile.matchPercentage}% Match
{/* Location & Member Since */}
Location {profile.location}
Member Since Member Since {profile.memberSince}
{/* Bio */}

{showFullBio ? profile.bio : truncatedBio} {profile.bio.length > 150 && ( )}

{/* Expertise */}

Expertise:

{profile.expertise.map((tag, index) => ( {tag} ))}
{/* Certifications */}
{profile.certifications.map((cert, index) => ( {cert} ))}
); } export default function ProfilesPage() { const searchParams = useSearchParams(); const [searchQuery, setSearchQuery] = useState(''); const [activeTab, setActiveTab] = useState('residential'); const [listingType, setListingType] = useState<'agents' | 'lenders'>('agents'); const [isFilterModalOpen, setIsFilterModalOpen] = useState(false); const [filters, setFilters] = useState({ clientSpecialization: [], loanType: [], propertyType: [], pricePoint: [], specialInterests: [], popularFilters: [], }); const toggleFilter = (category: string, option: string) => { setFilters(prev => ({ ...prev, [category]: (prev[category as keyof FilterState] || []).includes(option) ? (prev[category as keyof FilterState] || []).filter((o: string) => o !== option) : [...(prev[category as keyof FilterState] || []), option] })); }; const clearAllFilters = () => { setFilters({ clientSpecialization: [], loanType: [], propertyType: [], pricePoint: [], specialInterests: [], popularFilters: [], }); }; const applyFilters = () => { setIsFilterModalOpen(false); // Apply filter logic here }; return (
{/* Left Sidebar */}
{/* Listing Type */}

Listing Type

{/* Filters */}

Filters

toggleFilter('clientSpecialization', option)} /> toggleFilter('loanType', option)} /> toggleFilter('propertyType', option)} showMore /> toggleFilter('pricePoint', option)} />
{/* Main Content */}
{/* Search Bar */}
setSearchQuery(e.target.value)} className="w-full h-[44px] px-4 pr-12 rounded-[10px] border border-[#00293d]/20 bg-white font-serif text-[14px] text-[#00293d] placeholder:text-[#00293d]/50 focus:outline-none focus:border-[#e58625]" />
{/* Category Tabs */}
{categoryTabs.map((tab) => ( ))}
{/* Profile Cards */}
{profilesData.map((profile) => ( ))}
{/* Filter Modal */} setIsFilterModalOpen(false)} filters={filters} onToggleFilter={toggleFilter} onClearAll={clearAllFilters} onApply={applyFilters} />
); }