"use client"; import { AtUri } from "@atproto/api"; import { PubIcon } from "components/ActionBar/Publications"; import { CommentTiny } from "components/Icons/CommentTiny"; import { QuoteTiny } from "components/Icons/QuoteTiny"; import { Separator } from "components/Layout"; import { usePubTheme } from "components/ThemeManager/PublicationThemeProvider"; import { BaseThemeProvider } from "components/ThemeManager/ThemeProvider"; import { useSmoker } from "components/Toast"; import { PubLeafletDocument, PubLeafletPublication } from "lexicons/api"; import { blobRefToSrc } from "src/utils/blobRefToSrc"; import type { Post } from "app/(home-pages)/reader/getReaderFeed"; import Link from "next/link"; import { InteractionPreview } from "./InteractionsPreview"; export const PostListing = (props: Post) => { let pubRecord = props.publication.pubRecord as PubLeafletPublication.Record; let postRecord = props.documents.data as PubLeafletDocument.Record; let postUri = new AtUri(props.documents.uri); let theme = usePubTheme(pubRecord.theme); let backgroundImage = pubRecord?.theme?.backgroundImage?.image?.ref ? blobRefToSrc( pubRecord?.theme?.backgroundImage?.image?.ref, new AtUri(props.publication.uri).host, ) : null; let backgroundImageRepeat = pubRecord?.theme?.backgroundImage?.repeat; let backgroundImageSize = pubRecord?.theme?.backgroundImage?.width || 500; let showPageBackground = pubRecord.theme?.showPageBackground; let quotes = props.documents.document_mentions_in_bsky?.[0]?.count || 0; let comments = pubRecord.preferences?.showComments === false ? 0 : props.documents.comments_on_documents?.[0]?.count || 0; let tags = (postRecord?.tags as string[] | undefined) || []; return (

{postRecord.title}

{postRecord.description}

); }; const PubInfo = (props: { href: string; pubRecord: PubLeafletPublication.Record; uri: string; }) => { return (

{props.pubRecord.name}
); }; const PostInfo = (props: { publishedAt: string | undefined }) => { return (
{props.publishedAt && ( <>
{new Date(props.publishedAt).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", })}
)}
); };