"use client"; /** * PostScrollCard — Instagram-style post used on the scroll feed. * * Layout: * * ┌───────────────────────────────────────┐ * │ ◯ name @handle ⋮ │ ← author header (TBD) * ├───────────────────────────────────────┤ * │ │ * │ image carousel │ ← square, swipeable * │ (or quote) │ (no-image variant * │ │ fills with gradient * │ • ○ ○ ○ │ panel + serif quote) * ├───────────────────────────────────────┤ * │ "Quoted passage shown as caption…" │ ← truncates with "more" * │ ŚRĪMAD-BHĀGAVATAM — CANTO 4, CH 5 │ ← citation * └───────────────────────────────────────┘ * * • Multi-image carousel uses native CSS scroll-snap with dot indicators * below; the same primitive CollectionScrollCard uses for posts. * • Long captions clamp to 3 lines until the user expands via "more". * • Owner action cluster (Update background / Delete) sits in the * top-right of the media area, fading in on hover (desktop) and * always visible on touch (mobile). */ import { useState } from "react"; import Image from "next/image"; import Link from "next/link"; import { ImageIcon, Trash2 } from "lucide-react"; import { cn } from "@/lib/utils"; import type { Post, PostImage } from "@/lib/social"; import { displaySourceLabel } from "@/lib/source-reference"; import { useMediaQuery } from "@/components/selection-toolbar/shared"; import { postSourceHref, quoteCardBgStyle } from "./post-card-shared"; import { PostActionsFooter } from "./post-actions-footer"; import { UpdateBackgroundModal } from "./update-background-modal"; export function PostScrollCard({ post, onDelete, onUpdated, }: { post: Post; onDelete?: (id: string) => void; onUpdated?: (updated: Post) => void; }) { const images = post.images ?? []; const hasImages = images.length > 0; const sourceHref = postSourceHref(post); const isMobile = useMediaQuery("(max-width: 767px)"); const [bgModal, setBgModal] = useState(false); const [expanded, setExpanded] = useState(false); const ownerCluster = onUpdated || onDelete ? (
“{post.caption}”
“{text}”
{longEnough ? ( ) : null}