"use client"; /** * CollectionGridCard — square collection card for the 2-per-row grid view. * * • With cover: cover fills the square; bottom-up overlay for legibility. * • Without cover: the same flat palette-aware surface that post cards * fall back to — pure white on light themes, palette-specific dark * contrast on dark themes (see `--quote-card-bg`). * * Visibility badge (Globe/Lock) sits top-right. Title + count read * bottom-centre in white over the cover image's dark overlay; on the * flat fallback they use `text-foreground` so they invert cleanly with * the theme. */ import Image from "next/image"; import Link from "next/link"; import { Globe, Lock } from "lucide-react"; import { cn } from "@/lib/utils"; import type { Collection } from "@/lib/social"; import { quoteCardBgStyle } from "./post-card-shared"; export function CollectionGridCard({ collection: c, href, }: { collection: Collection; href: string; }) { const hasCover = !!c.cover_url; return ( {hasCover ? ( <>
) : (
)} {/* Visibility badge — black pill works on both image overlay and flat surface (white or dark). */} {c.is_public ? null : (
{"Private"}
)} {/* Title + count — text colour follows the surface beneath. */}

{c.title}

{c.item_count} post{c.item_count === 1 ? "" : "s"}

); }