import re

with open('src/app/map/MapUI.tsx', 'r') as f:
    content = f.read()

# Fix MapController signature
content = re.sub(
    r'function MapController\(\{ center, zoom, hoveredId, properties, L \}: \{ center: \[number, number\], zoom: number, hoveredId: string \| null, properties: any\[\], L: any \}\) \{',
    r'function MapController({ center, zoom, hoveredId, properties, L, searchedLocation, setSearchedLocation }: { center: [number, number], zoom: number, hoveredId: string | null, properties: any[], L: any, searchedLocation: [number, number] | null, setSearchedLocation: any }) {',
    content
)

# Fix MapController call
content = re.sub(
    r'<MapController\n\s*center=\{center\}\n\s*zoom=\{12\}\n\s*hoveredId=\{hoveredPropertyId\}\n\s*properties=\{filteredProperties\}\n\s*L=\{L\}\n\s*/>',
    r'<MapController\n                  center={center}\n                  zoom={12}\n                  hoveredId={hoveredPropertyId}\n                  properties={filteredProperties}\n                  L={L}\n                  searchedLocation={searchedLocation}\n                  setSearchedLocation={setSearchedLocation}\n                />',
    content
)

with open('src/app/map/MapUI.tsx', 'w') as f:
    f.write(content)
