import { FlexBox } from '../../atoms/flex-box'; import { Card } from '../../molecules/card'; import { cn } from '../../tools/cn'; import { PostAccess } from './components/PostAccess'; import { PostAccessNote } from './components/PostAccessNote'; import { PostActions } from './components/PostActions'; import { PostContent } from './components/PostContent'; import { PostHead } from './components/PostHead'; import { PostLocked } from './components/PostLocked'; import { LINKED_CARD_CLASS } from './constants'; import type { PostCardProps } from './types'; /** * The one post for the channel, the feed and the post page: free, locked, subscriber and owner * views of text, image and prediction posts. A locked post keeps the header and swaps the body * for the shared LockedTeaser, so locking never changes the feed's rhythm. * * Server-renderable: only a multi-image carousel, a frozen edit's tooltip and the desktop share * menu are client parts. The handlers (`owner`, `onShare`, `onCopyLink`, `onImageClick`, `onCta`) * need a client caller; a server render passes `href`, `channelHref` and `ctaHref` links instead. */ export function PostCard(props: PostCardProps) { const { author, channelHref, href, publishedAt, now, timeLabel, ownerTag, premium = props.locked ?? false, edited = false, variant = 'compact', predictionLabels, owner, onShare, onCopyLink, accessNote, labels, className, } = props; return ( {props.locked ? ( ) : ( )} {owner?.accessFrozen && props.prediction == null && ( )} {!props.locked && accessNote != null && ( {accessNote} )} ); }