import type { LatLng } from "leaflet"; import type { LocationState } from "@/components/MemoEditor/types/insert-menu"; import { LocationPicker } from "@/components/map"; import { Button } from "@/components/ui/button"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { VisuallyHidden } from "@/components/ui/visually-hidden"; import { useTranslate } from "@/utils/i18n"; interface LocationDialogProps { open: boolean; onOpenChange: (open: boolean) => void; state: LocationState; onPositionChange: (position: LatLng) => void; onUpdateCoordinate: (type: "lat" | "lng", value: string) => void; onPlaceholderChange: (placeholder: string) => void; onCancel: () => void; onConfirm: () => void; } export const LocationDialog = ({ open, onOpenChange, state, onPositionChange, onUpdateCoordinate, onPlaceholderChange, onCancel, onConfirm, }: LocationDialogProps) => { const t = useTranslate(); const { placeholder, position, latInput, lngInput } = state; return ( {t("tooltip.select-location")} Select a location on the map or enter coordinates manually
onUpdateCoordinate("lat", e.target.value)} className="h-9" />
onUpdateCoordinate("lng", e.target.value)} className="h-9" />