File size: 759 Bytes
a73dbfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
'use client';

import styles from './MapPreview.module.css';

export default function MapPreview({ lat, lng, label = 'Buka Map' }) {
    const mapUrl = `https://www.google.com/maps?q=${lat},${lng}`;

    return (
        <div className={styles.container}>
            <div className={styles.mapPlaceholder}>
                <span className={styles.pinIcon}>📍</span>
                <span className={styles.coords}>
                    {lat?.toFixed(4)}, {lng?.toFixed(4)}
                </span>
            </div>
            <a
                href={mapUrl}
                target="_blank"
                rel="noopener noreferrer"
                className={styles.openBtn}
            >
                {label}
            </a>
        </div>
    );
}