Skip to content

Commit

Permalink
πŸ₯… Maps component - handle errors better
Browse files Browse the repository at this point in the history
  • Loading branch information
bradystroud committed Oct 6, 2024
1 parent cb24f35 commit 543c5e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/blocks/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ interface MapEmbedProps {
const MapEmbed: React.FC<MapEmbedProps> = ({ location }) => {
const GOOGLE_MAPS_API_KEY = process.env.GOOGLE_MAPS_API_KEY;

if (!GOOGLE_MAPS_API_KEY) return <p>No maps today πŸ˜”</p>;

if (!location) {
return <p>No location provided πŸ˜”</p>;
}

return (
<iframe
width="600"
Expand Down

0 comments on commit 543c5e6

Please sign in to comment.