import { ContentShareButton } from '@/components/ContentShareButton' import type { ContentShareKind } from '@/lib/contentShare' import { PUBLIC_FOCUS } from '@/lib/publicSite' import Image from 'next/image' import Link from 'next/link' export type CampaignContentCardData = { id: string | number href: string title: string meta: string /** Source of the content — drives the WhatsApp share message template. */ shareKind: ContentShareKind coverUrl?: string coverAlt?: string subtitle?: string /** External target (e.g. a YouTube video): opens in a new tab with noopener. */ external?: boolean } type CampaignContentCardProps = { card: CampaignContentCardData /** S47 — the editorial board is 1 featured + 3 compact text rows. */ variant?: 'featured' | 'compact' } const ACTION_LABELS: Record = { article: 'Ler notícia', video: 'Assistir no YouTube', instagram: 'Ver no Instagram', event: 'Ver', } const CARD_LINK = `block rounded-sm text-(--campaign-ink) no-underline ${PUBLIC_FOCUS}` /** * S47 — one item of the editorial home board (design scene 01/02): the * `featured` variant carries the cover of the lead story; the `compact` * variant is the text-only row of the side column. Both keep the S4 share * control as a sibling of the anchor (never nested inside it) and derive the * action label from the content source. */ export const CampaignContentCard = ({ card, variant = 'compact' }: CampaignContentCardProps) => { const featured = variant === 'featured' const actionLabel = ACTION_LABELS[card.shareKind] const inner = featured ? ( <>
{card.coverUrl ? ( {card.coverAlt ) : null}

{card.meta}

{card.title}

{card.subtitle ? (

{card.subtitle}

) : null} {actionLabel} ) : ( <>

{card.meta}

{card.title}

{actionLabel}

) return (
{card.external ? ( {inner} ) : ( {inner} )}
) }