'use client' import { memo } from 'react' import { Button, ButtonLink } from '@djangocfg/ui-core/components' import { cn } from '@djangocfg/ui-core/lib' import type { MarkerCard as MarkerCardData, MarkerCardAction } from '../cards/types' export interface MarkerCardProps extends MarkerCardData { /** Extra classes on the card root. */ className?: string } const VARIANT_MAP = { default: 'default', outline: 'outline', ghost: 'ghost', } as const function CardAction({ action }: { action: MarkerCardAction }) { const variant = VARIANT_MAP[action.variant ?? 'outline'] if (action.href) { return ( {action.icon} {action.label} ) } return ( ) } /** * MarkerCard — the DEFAULT presentational info-card for a map marker * (Google-Maps-desktop style). Renders from plain data: an optional image * header, a badge pill, a title, a clamped description, and an action row of * links/buttons. Standalone-usable (no map dependency) and built on semantic * tokens only. `MapMarkers` renders this inside a `MapPopup` above the pin. */ export const MarkerCard = memo(function MarkerCard({ title, description, image, badge, actions, className, }: MarkerCardProps) { return (
{image && ( {title} )}
{badge && ( {badge} )}

{title}

{description && (

{description}

)} {actions && actions.length > 0 && (
{actions.map((action, i) => ( ))}
)}
) })