This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { MapData } from './types';
|
||||
|
||||
// Leaflet CDN を動的にロードする
|
||||
@@ -33,6 +34,7 @@ function loadLeaflet(): Promise<void> {
|
||||
declare const L: typeof import('leaflet');
|
||||
|
||||
export function MapPlacesDetail({ data }: { data: MapData }) {
|
||||
const { t } = useTranslation('embed');
|
||||
const { query, places } = data;
|
||||
const mapRef = useRef<HTMLDivElement>(null);
|
||||
const mapInstanceRef = useRef<import('leaflet').Map | null>(null);
|
||||
@@ -85,7 +87,7 @@ export function MapPlacesDetail({ data }: { data: MapData }) {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h2 className="text-lg font-bold text-slate-800 mb-4">
|
||||
📍 地図検索結果: 「{query}」
|
||||
📍 {t('searchResults.map', { query })}
|
||||
</h2>
|
||||
|
||||
{/* Leaflet map */}
|
||||
@@ -115,7 +117,7 @@ export function MapPlacesDetail({ data }: { data: MapData }) {
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 px-3 py-1.5 bg-slate-100 hover:bg-slate-200 text-slate-700 text-xs font-semibold rounded-lg no-underline transition-colors"
|
||||
>
|
||||
OpenStreetMap で開く
|
||||
{t('viewOn.osm')}
|
||||
</a>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user