"use client"; import Link from "next/link"; import { useIdentityData } from "components/IdentityProvider"; import { theme } from "tailwind.config"; import { getBasePublicationURL } from "app/lish/createPub/getPublicationURL"; import { Json } from "supabase/database.types"; import { PubLeafletPublication } from "lexicons/api"; import { AtUri } from "@atproto/syntax"; import { ActionButton } from "./ActionButton"; import { SpeedyLink } from "components/SpeedyLink"; import { PublishSmall } from "components/Icons/PublishSmall"; export const PublicationButtons = (props: { currentPubUri: string | undefined; }) => { let { identity } = useIdentityData(); // don't show pub list button if not logged in or no pub list // we show a "start a pub" banner instead if (!identity || !identity.atp_did) return ; return (
{identity.publications?.map((d) => { // console.log("thisURI : " + d.uri); // console.log("currentURI : " + props.currentPubUri); return ( ); })} New
); }; export const PublicationOption = (props: { uri: string; name: string; record: Json; asActionButton?: boolean; current?: boolean; }) => { let record = props.record as PubLeafletPublication.Record | null; if (!record) return; return ( {props.asActionButton ? ( } nav className={props.current ? "bg-bg-page! border-border!" : ""} /> ) : ( <>
{record.name}
)}
); }; const PubListEmpty = () => { return ( } nav subtext="Start a blog in the Atmosphere" /> ); }; export const PubIcon = (props: { record: PubLeafletPublication.Record; uri: string; small?: boolean; large?: boolean; className?: string; }) => { if (!props.record) return; let iconSizeClassName = `${props.small ? "w-4 h-4" : props.large ? "w-12 h-12" : "w-6 h-6"} rounded-full`; return props.record.icon ? (
) : (
{props.record?.name.slice(0, 1)}
); }; export const PubListEmptyIllo = () => { return ( ); };