···
+
import { Post } from "./pdsfetch";
+
import { Config } from "../../config";
+
import { onMount } from "svelte";
+
import moment from "moment";
+
let { post }: { post: Post } = $props();
+
<div class="postContainer">
+
<div class="postHeader">
+
{#if post.author.avatar}
+
src="{post.author.avatar}"
+
alt="avatar of {post.author.displayName}"
+
<div class="headerText">
+
<a class="displayName" href="{Config.FRONTEND_URL}/profile/{post.author.did}">{post.author.displayName}</a>
+
<a href="{Config.FRONTEND_URL}/profile/{post.author.handle}"
+
>@{post.author.handle}</a
+
class="postLink" href="{Config.FRONTEND_URL}/profile/{post.author.did}/post/{post.record.id}"
+
>{moment(post.record.createdAt).isBefore(moment().subtract(1, "month"))
+
? moment(post.record.createdAt).format("MMM D, YYYY")
+
: moment(post.record.createdAt).fromNow()}</a>
+
<div class="postContent">
+
{#if post.record.quote}
+
href="{Config.FRONTEND_URL}/profile/{post.record.quote.uri}/post/{post
+
.quotingUri.rkey}">quoting {post.quotingUri.repo}</a
+
<div class="postText">{post.record.text}</div>
+
{#if post.record.imagesCid && post.record.imagesCid.length > 0}
+
<div id="carouselContainer">
+
alt="Post Image {currentImageIndex + 1} of {post.record.imagesCid.length}"
+
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.record.author.did}&cid={post.record
+
.imagesCid[currentImageIndex]}"
+
{#if post.imagesCid.length > 1}
+
<div class="carouselControls">
+
disabled={currentImageIndex === 0}>←</button
+
<div class="carouselIndicators">
+
{#each post.record.imagesCid as _, i}
+
class="indicator {i === currentImageIndex ? 'active' : ''}"
+
disabled={currentImageIndex === post.imagesCid.length - 1}
+
{#if post.record.videosLinkCid}
+
<!-- svelte-ignore a11y_media_has_caption -->
+
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.videosLinkCid}"
+
src="{post.record.gifLink}"