File size: 764 Bytes
691cdd0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';

export default function MapEmbed({ address, title = 'Project location' }) {
  if (!address) return null;
  const src = `https://www.google.com/maps?q=${encodeURIComponent(address)}&output=embed`;

  return (
    <section className="mt-6" aria-labelledby="map-heading">
      <h3 id="map-heading" className="h3 mb-3">Location</h3>
      <div className="overflow-hidden rounded-xl border border-slate-200 bg-slate-50">
        <iframe
          title={title}
          src={src}
          loading="lazy"
          referrerPolicy="no-referrer-when-downgrade"
          className="h-64 w-full md:h-72"
        />
      </div>
      <p className="mt-2 text-xs text-slate-500">Based on project location: {address}</p>
    </section>
  );
}