import { ProfileView } from "$lexicon/types/social/grain/actor/defs.ts"; import { Record as Comment } from "$lexicon/types/social/grain/comment.ts"; import { CommentView } from "$lexicon/types/social/grain/comment/defs.ts"; import { GalleryView, isGalleryView, } from "$lexicon/types/social/grain/gallery/defs.ts"; import { isPhotoView, PhotoView, } from "$lexicon/types/social/grain/photo/defs.ts"; import { $Typed } from "$lexicon/util.ts"; import { Facet } from "@atproto/api"; import { AtUri } from "@atproto/syntax"; import { BffContext, BffMiddleware, route, WithBffMeta } from "@bigmoves/bff"; import { cn } from "@bigmoves/bff/components"; import { Dialog } from "..//components/Dialog.tsx"; import { ActorAvatar } from "../components/ActorAvatar.tsx"; import { ActorInfo } from "../components/ActorInfo.tsx"; import { Button } from "../components/Button.tsx"; import { GalleryPreviewLink } from "../components/GalleryPreviewLink.tsx"; import { RenderFacetedText } from "../components/RenderFacetedText.tsx"; import { Textarea } from "../components/Textarea.tsx"; import { getActorProfile, getActorProfilesBulk } from "../lib/actor.ts"; import { BadRequestError } from "../lib/errors.ts"; import { getGalleriesBulk, getGallery } from "../lib/gallery.ts"; import { getPhoto, getPhotosBulk } from "../lib/photo.ts"; import { parseFacetedText } from "../lib/rich_text.ts"; import { formatRelativeTime } from "../utils.ts"; export function ReplyDialog({ userProfile, gallery, photo, comment }: Readonly<{ userProfile: ProfileView; gallery?: GalleryView; photo?: PhotoView; comment?: CommentView; }>) { const galleryRkey = gallery ? new AtUri(gallery.uri).rkey : undefined; const profile = gallery?.creator; return ( Add a comment
{!comment && profile ? : null} {comment ? : null}
{comment?.author ?
{comment.author.displayName}
: (
{gallery?.creator.displayName}
)} {comment?.text && ( )} {!comment && !photo && gallery && gallery.title} {!comment && !photo && gallery ? (
) : null} {photo ? (
{photo.alt}
) : null}
{!comment && photo ? : null} {comment ? : null}