import Image from 'next/image' import Link from 'next/link' export type CampaignContentCardData = { id: string | number href: string title: string badgeLabel: string meta: string 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 = (featured: boolean) => `group flex h-full flex-col rounded-xl border border-(--campaign-line) bg-white p-3 shadow-sm transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--pt-red) ${ featured ? 'gap-3' : 'gap-2' }` /** * 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). */ export const CampaignContentCard = ({ card, featured = false }: CampaignContentCardProps) => { const inner = ( <>
{card.subtitle}
) : null} {card.meta}