"use client"; import * as React from "react"; import { Card, CardContent, CardHeader, CardTitle, CardDescription, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { Trash2, MilestoneIcon, Clock } from "lucide-react"; import { Location } from "@/types/types"; import getOsmEmbedUrl from "@/lib/osmEmbed"; import LocationDialog from "./location-dialog"; import openNavigationApp from "@/lib/openNavigationMap"; import formatLocation from "@/lib/formatLocation"; interface LocationCardProps { location: Location; onUpdate?: (location: Location) => void; onDelete?: (location: Location) => void; canUpdate?: boolean; canDelete?: boolean; } export const LocationCard: React.FC = ({ location, onUpdate, onDelete, canDelete = false, canUpdate = false, }) => { const [isDialogOpen, setIsDialogOpen] = React.useState(false); const handleDelete = () => { onDelete?.(location); setIsDialogOpen(false); }; return (
{location.street} {location.city}, {location.postalCode}
{/* OSM Embed Map */} {location.latitude && location.longitude && (