11"use client" ;
2-
32import { useState } from "react" ;
43import Link from "next/link" ;
54
65export default function ChileMap ( { cities } ) {
76 const [ activeCity , setActiveCity ] = useState ( null ) ;
8-
7+
98 return (
10- < div className = "relative mx-auto w-1/3" >
11- < div className = "aspect-[3/6] w-full bg-white/10 backdrop-blur-sm rounded-lg p-4 relative" >
12- { /* SVG simplificado del mapa de Chile */ }
13- < svg viewBox = "0 0 100 300" className = "w-full h-full" >
14- < path
15- d = "M50,20 Q60,50 55,100 Q50,150 60,200 Q70,250 50,280"
16- fill = "none"
17- stroke = "white"
18- strokeWidth = "2"
19- className = "opacity-50"
20- />
21-
22- { cities . map ( ( city ) => (
23- < g
24- key = { city . slug }
25- onClick = { ( ) => setActiveCity ( city . slug ) }
26- className = "cursor-pointer"
27- >
28- < circle
29- cx = { city . mapCoords . x }
30- cy = { city . mapCoords . y }
31- r = { activeCity === city . slug ? 6 : 4 }
32- fill = { activeCity === city . slug ? "#FFD700" : "#8A2BE2" }
33- className = "transition-all duration-300"
34- />
35- < text
36- x = { city . mapCoords . x + 8 }
37- y = { city . mapCoords . y + 4 }
38- fontSize = "8"
39- fill = "white"
40- className = "pointer-events-none"
9+ < div className = "flex flex-col md:flex-row justify-between gap-8 mx-auto max-w-6xl px-4" >
10+ { /* Mapa SVG - Más grande en móvil y adaptativo en escritorio */ }
11+ < div className = "w-full md:w-1/2 lg:w-2/5 mx-auto" >
12+ < div className = "aspect-[3/6] w-full bg-white/10 backdrop-blur-sm rounded-lg p-4 relative" >
13+ { /* SVG simplificado del mapa de Chile */ }
14+ < svg viewBox = "0 0 100 300" className = "w-full h-full" >
15+ < path
16+ d = "M50,20 Q60,50 55,100 Q50,150 60,200 Q70,250 50,280"
17+ fill = "none"
18+ stroke = "white"
19+ strokeWidth = "2"
20+ className = "opacity-50"
21+ />
22+ { cities . map ( ( city ) => (
23+ < g
24+ key = { city . slug }
25+ onClick = { ( ) => setActiveCity ( city . slug ) }
26+ className = "cursor-pointer"
4127 >
42- { city . name }
43- </ text >
44- </ g >
45- ) ) }
46- </ svg >
28+ < circle
29+ cx = { city . mapCoords . x }
30+ cy = { city . mapCoords . y }
31+ r = { activeCity === city . slug ? 6 : 4 }
32+ fill = { activeCity === city . slug ? "#FFD700" : "#8A2BE2" }
33+ className = "transition-all duration-300"
34+ />
35+ < text
36+ x = { city . mapCoords . x + 8 }
37+ y = { city . mapCoords . y + 4 }
38+ fontSize = "8"
39+ fill = "white"
40+ className = "pointer-events-none"
41+ >
42+ { city . name }
43+ </ text >
44+ </ g >
45+ ) ) }
46+ </ svg >
47+ </ div >
4748 </ div >
48-
49- < div className = "mt-6 space-y-4" >
49+
50+ { /* Lista de ciudades - A la derecha en desktop, abajo en móvil */ }
51+ < div className = "w-full md:w-1/2 mt-6 md:mt-0 space-y-4" >
5052 { cities . map ( ( city ) => (
5153 < Link
5254 href = { `/${ city . slug } ` }
@@ -75,4 +77,4 @@ export default function ChileMap({ cities }) {
7577 </ div >
7678 </ div >
7779 ) ;
78- }
80+ }
0 commit comments