'use client'; import { useState } from 'react'; import { EnvironmentOutlined } from '@ant-design/icons'; import { useLanguage } from '@/app/context/LanguageContext'; import { useTheme } from '@/app/context/ThemeContext'; import { mapLocations } from '@/data/content'; // --------------------------------------------------------------------------- // Neshan (نشان) map integration. // // TODO: put your Neshan API key here, or (preferred) set it as an environment // variable in `.env.local`: // NEXT_PUBLIC_NESHAN_API_KEY=your-key-here // Get a key from https://platform.neshan.org // --------------------------------------------------------------------------- const NESHAN_API_KEY = process.env.NEXT_PUBLIC_NESHAN_API_KEY || ''; // Neshan's Static Map API — a plain image, no JS SDK/script tag needed. // Verify query param names/values against the current Neshan docs // (https://platform.neshan.org/api/static-map/) if this ever needs updating — // `type` accepts their day/night map styles, e.g. "standard-day" / "standard-night". function staticMapUrl({ lat, lng }, mapStyle) { const params = new URLSearchParams({ key: NESHAN_API_KEY, type: mapStyle, center: `${lat},${lng}`, zoom: '15', size: '600x400', marker: `${lat},${lng}`, }); return `https://api.neshan.org/v5/static?${params.toString()}`; } function neshanViewUrl({ lat, lng }) { return `https://neshan.org/maps/@${lat},${lng},15z`; } function MapThumb({ coords, mapStyle, alt }) { const [errored, setErrored] = useState(false); const { t } = useLanguage(); if (!NESHAN_API_KEY || errored) { return (
{t.map.configNotice}