-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.tsx
More file actions
67 lines (61 loc) · 2.05 KB
/
index.tsx
File metadata and controls
67 lines (61 loc) · 2.05 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { FC, useEffect, useRef } from 'react';
import { Card, Col, Container, Row, Spinner } from 'react-bootstrap';
export interface MapProps {
data?: { name: string; city?: string; province?: string; latitude?: number; longitude?: number }[];
loading?: boolean;
}
export const Map: FC<MapProps> = ({ data = [], loading = false }) => {
const mapRef = useRef<HTMLDivElement>(null);
useEffect(() => {
// Placeholder for actual map implementation
// This would integrate with a mapping library like Leaflet, AMap, or MapBox
}, []);
if (loading) {
return (
<Container className="d-flex justify-content-center align-items-center" style={{ minHeight: '400px' }}>
<Spinner animation="border" role="status">
<span className="visually-hidden">Loading...</span>
</Spinner>
</Container>
);
}
return (
<Container>
<Row>
<Col>
<Card>
<Card.Body>
<div
ref={mapRef}
style={{
width: '100%',
height: '500px',
backgroundColor: '#f8f9fa',
border: '1px solid #dee2e6',
borderRadius: '0.375rem',
position: 'relative',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<div className="text-center text-muted">
<h5>Interactive Map Coming Soon</h5>
<p>Geographic visualization of {data.length} organizations</p>
{data.length > 0 && (
<small>
Data includes organizations from{' '}
{[...new Set(data.map(item => item.province || item.city).filter(Boolean))].length}{' '}
locations
</small>
)}
</div>
</div>
</Card.Body>
</Card>
</Col>
</Row>
</Container>
);
};
export default Map;