"use client"; import { ChevronLeft, Clock, MapPin, Phone } from "lucide-react"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { cn } from "@/lib/utils"; interface StoreLocation { id: string; name: string; address: string; city: string; phone: string; hours: string; distance?: string; mapQuery: string; } interface Contact23Props { title?: string; description?: string; locations?: StoreLocation[]; defaultMapQuery?: string; className?: string; } const Contact23 = ({ title = "نزدیک‌ترین مرکز پشتیبانی", description = "شهر یا کد پستی را وارد کنید تا نزدیک‌ترین دفتر فروش یا مرکز پشتیبانی CRM را پیدا کنید.", locations = [ { id: "1", name: "مرکز پشتیبانی مرکزی", address: "Valiasr St, District 6", city: "Tehran, Iran", phone: "۲۱-۱۲۳۴۵۶۷۸", hours: "شنبه تا چهارشنبه ۹ تا ۱۸، پنج‌شنبه ۹ تا ۱۴", distance: "۱۳ کیلومتر", mapQuery: "Valiasr Street, Tehran, Iran", }, { id: "2", name: "دفتر فروش ونک", address: "Vanak Square, District 3", city: "Tehran, Iran", phone: "۲۱-۸۸۷۷۶۶۵۵", hours: "شنبه تا چهارشنبه ۹ تا ۱۷، پنج‌شنبه ۹ تا ۱۳", distance: "۲ کیلومتر", mapQuery: "Vanak Square, Tehran, Iran", }, { id: "3", name: "مرکز موفقیت مشتری سعادت‌آباد", address: "Seyyed Khandan St", city: "Tehran, Iran", phone: "۲۱-۴۴۰۱۱۲۲", hours: "شنبه تا چهارشنبه ۹ تا ۱۷", distance: "۴.۲ کیلومتر", mapQuery: "Saadat Abad, Tehran, Iran", }, { id: "4", name: "دفتر سازمانی تجریش", address: "Tajrish Square", city: "Tehran, Iran", phone: "۲۱-۲۲۷۷۸۸۹۹", hours: "شنبه تا چهارشنبه ۹ تا ۱۸", distance: "۵.۱ کیلومتر", mapQuery: "Tajrish, Tehran, Iran", }, ], defaultMapQuery = "تهران، ایران", className, }: Contact23Props) => { const [selectedLocation, setSelectedLocation] = useState(null); const mapQuery = selectedLocation?.mapQuery || defaultMapQuery; return (

{title}

{description}

{locations.map((location) => (
setSelectedLocation(location)} className={cn( "group cursor-pointer rounded-xl border bg-background p-5 transition-colors hover:border-primary/50 hover:bg-muted/30", selectedLocation?.id === location.id && "border-primary bg-muted/30", )} >

{location.name}

{location.distance && ( {location.distance} )}

{location.address}

{location.city}

{location.hours}
))}