import { ContentShareButton } from '@/components/ContentShareButton' import type { ContentShareKind } from '@/lib/contentShare' 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 /** Cover ratio: 16:9 for articles/videos, 1:1 for Instagram posts. */ coverAspect?: 'video' | 'square' /** External target (e.g. a YouTube video): opens in a new tab with noopener. */ external?: boolean } type CampaignContentCardProps = { card: CampaignContentCardData featured?: boolean } const cardClassName = 'flex h-full flex-col bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--pt-red)' /** * Presentational content card for the campaign home content bento/carousel — * one spelling for every source (article, YouTube, Instagram in S3). Internal * targets use `Link`; external ones open on the platform in a new tab with * `noopener` (no inline player, per the approved wireframe). The card body is * one anchor; the S4 share control lives as an absolutely positioned sibling * (a button inside the anchor would be invalid interactive nesting), on a * wrapper that also owns the hover `group` so the cover zoom keeps working. */ export const CampaignContentCard = ({ card, featured = false }: CampaignContentCardProps) => { const inner = ( <>
{card.subtitle}
) : null} {card.meta}