import os

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

blue_dot_html = """
      {searchedLocation && (
        <Marker
          position={searchedLocation}
          icon={L.divIcon({
            className: 'custom-user-location-marker',
            html: `
              <div class="relative flex h-6 w-6">
                <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"></span>
                <span class="relative inline-flex rounded-full h-6 w-6 bg-blue-600 border-2 border-white shadow-lg shadow-blue-500/50"></span>
              </div>
            `,
            iconSize: [24, 24],
            iconAnchor: [12, 12]
          })}
          zIndexOffset={2000}
        />
      )}
"""

# Insert the blue dot after the property markers
content = content.replace(
    '        />\n       );\n      })}\n     </MapContainer>',
    '        />\n       );\n      })}\n' + blue_dot_html + '     </MapContainer>'
)

with open(filepath, 'w') as f:
    f.write(content)
print("Blue dot added.")
