import React from 'react' import { useDraggable } from '@dnd-kit/core' import { MapPin, DollarSign, Check } from 'lucide-react' export default function DraggablePlaceCard({ place, isAssigned, onEdit }) { const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({ id: `place-${place.id}`, data: { type: 'place', place, }, }) const style = transform ? { transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`, zIndex: isDragging ? 999 : undefined, } : undefined return (
{ if (!isDragging && onEdit) { e.stopPropagation() onEdit(place) } }} > {/* Category left border accent */} {place.category && (
)}
{/* Header */}

{place.name}

{isAssigned && ( )}
{/* Address */} {place.address && (

{place.address}

)} {/* Category badge */} {place.category && ( {place.category.name} )} {/* Price */} {place.price != null && ( {Number(place.price).toLocaleString()} {place.currency || ''} )} {/* Tags */} {place.tags && place.tags.length > 0 && (
{place.tags.slice(0, 3).map(tag => ( {tag.name} ))} {place.tags.length > 3 && ( +{place.tags.length - 3} )}
)}
) }