import Link from 'next/link' import { contentPieceMediaKind, type ContentPiecePublicItem } from '@/lib/contentPieceCatalog' import { cn } from '@/lib/utils' import { ContentPieceDownloadLink, ContentPieceShareButton } from './ContentPieceActions' import { ContentPieceMedia } from './ContentPieceMedia' import { CONTENT_PIECE_CARD, CONTENT_PIECE_TAG } from './contentPieceClasses' type ContentPieceCardProps = { item: ContentPiecePublicItem playing: boolean onToggle: () => void onEnded: () => void onShare: (item: ContentPiecePublicItem) => void } const CardTag = ({ item }: { item: ContentPiecePublicItem }) => ( {item.isLink ? item.originLabel : item.typeLabel} ) const CardTitle = ({ item, className }: { item: ContentPiecePublicItem; className?: string }) => (

{item.title}

) const CardMeta = ({ item }: { item: ContentPiecePublicItem }) => item.metaLabel ?

{item.metaLabel}

: null /** * S27 — one catalogue card (artefato: cenas 01/02/07): video/audio/card and * link pieces take the full card with the asset on top; a photo/text is the * compact horizontal row. Actions work from the card itself — download never * needs the piece page. */ export const ContentPieceCard = ({ item, playing, onToggle, onEnded, onShare, }: ContentPieceCardProps) => { const kind = contentPieceMediaKind(item) const isCompact = kind === 'image' || kind === 'text' || kind === 'other' if (isCompact) { return (
) } return (
Ver detalhes da peça →
) }