import type { MetaFunction } from "@remix-run/node";
import { ClientOnly } from "../components/ClientOnly";
import { Suspense, useState } from "react";
import ProfilePagesHeader from "../components/ProfilePagesHeader";
import { lazyWithPreload } from "~/utils/lazy-import";
import { MapPin } from "lucide-react";
export const meta: MetaFunction = () => {
return [
{ title: "افزودن آدرس" },
{
name: "description",
content: "افزودن آدرس برای انتخاب موقعیت و دریافت آدرس",
},
];
};
export default function AddLocation() {
const [showMap, setShowMap] = useState(false);
return (
{!showMap ? (
// Show form first with option to use map
در حال بارگذاری...
}
>
{() => {
const InteractiveMap = lazyWithPreload(
() => import("../components/InteractiveMap")
);
return (
}
>
{/* Button to show map */}
{/* Form only mode */}
);
}}
) : (
// Show map when user clicks the button
در حال بارگذاری نقشه...
}
>
{() => {
const InteractiveMap = lazyWithPreload(
() => import("../components/InteractiveMap")
);
return (
}
>
{/* Back button */}
);
}}
)}
);
}