diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1c85e45..70effd4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,9 +3,8 @@ - - - + + diff --git a/components/MapSection.jsx b/components/MapSection.jsx index 68cde7e..38d6979 100644 --- a/components/MapSection.jsx +++ b/components/MapSection.jsx @@ -3,11 +3,12 @@ // نقشه نشان (Neshan) — از Static Map API استفاده می‌کند. تا وقتی کلید API خالی باشد، // به‌جای نقشه یک پیام راهنما نشان داده می‌شود (نه تصویر خراب). -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'; +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'; +import Image from "next/image"; // --------------------------------------------------------------------------- // Neshan (نشان) map integration. @@ -23,94 +24,107 @@ const NESHAN_API_KEY = process.env.NEXT_PUBLIC_NESHAN_API_KEY || ''; // 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 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 neshanViewUrl({lat, lng}) { + return `https://neshan.org/maps/@${lat},${lng},15z`; } -function MapThumb({ coords, mapStyle, alt }) { - const [errored, setErrored] = useState(false); - const { t } = useLanguage(); +function MapThumb({coords, mapStyle, alt}) { + const [errored, setErrored] = useState(false); + const {t} = useLanguage(); + + if (!NESHAN_API_KEY || errored) { + return ( +
+ +

{t.map.configNotice}

+
+ ); + } - if (!NESHAN_API_KEY || errored) { return ( -
- -

{t.map.configNotice}

-
+ // eslint-disable-next-line @next/next/no-img-element + {alt} setErrored(true)} + className="w-full h-full object-cover" + /> ); - } - - return ( - // eslint-disable-next-line @next/next/no-img-element - {alt} setErrored(true)} - className="w-full h-full object-cover" - /> - ); } export default function MapSection() { - const { t } = useLanguage(); - const { theme } = useTheme(); - const mapStyle = theme === 'dark' ? 'standard-night' : 'standard-day'; + const {t} = useLanguage(); + const {theme} = useTheme(); + const mapStyle = theme === 'dark' ? 'standard-night' : 'standard-day'; - const pins = [ - { key: 'factory', label: t.map.factoryLabel, coords: mapLocations.factory, address: t.contactInfo.factoryAddress }, - { key: 'sales', label: t.map.salesLabel, coords: mapLocations.salesOffice, address: t.contactInfo.salesOfficeAddress }, - ]; + const pins = [ + { + key: 'factory', + label: t.map.factoryLabel, + coords: mapLocations.factory, + address: t.contactInfo.factoryAddress + }, + { + key: 'sales', + label: t.map.salesLabel, + coords: mapLocations.salesOffice, + address: t.contactInfo.salesOfficeAddress + }, + ]; - return ( -
-
-
- {t.map.eyebrow} -

{t.map.title}

-
- -
-
- -
- -
- {pins.map((pin) => ( -
-
-
- -
-
-

{pin.label}

-

{pin.address}

- - {t.map.openInMaps} ↗ - -
+ return ( +
+
+
+ {t.map.eyebrow} +

{t.map.title}

-
- ))} -
-
-
-
- ); + +
+
+ {/**/} + روبات مارکت +
+ +
+ {pins.map((pin) => ( +
+
+
+ +
+
+

{pin.label}

+

{pin.address}

+ + {t.map.openInMaps} ↗ + +
+
+
+ ))} +
+
+ + + ); } diff --git a/public/images/20260803_052807.png b/public/images/20260803_052807.png deleted file mode 100644 index 146cde8..0000000 Binary files a/public/images/20260803_052807.png and /dev/null differ