import type { Component } from 'solid-js' import { onMount } from 'solid-js' import { getContentAfterLastSlash, Text, timeDifference, fetchVideo } from '../lib/utils' import { DateFormat } from '../lib/types' interface Props { post: any; linkTarget: '_self' | '_blank' | '_parent' | '_top'; handleModalContent: any; isCard?: boolean; disableImages?: boolean; disableVideos?: boolean; disableAutoplay?: boolean; dateFormat?: DateFormat } const BskyPost: Component = ({ linkTarget = '_self', post, handleModalContent, isCard = false, dateFormat, disableImages, disableVideos, disableAutoplay, }: Props) => { let videoRef: HTMLVideoElement | undefined; onMount(() => { if (!disableVideos && post.video && post.video.cid) { fetchVideo(post.video, videoRef, disableAutoplay); } }); return
{ post.isRepost &&

Reposted by {post.repostBy}

}
{ !isCard && profile picture }

{post.text.map((t: Text) => t.setInnerHtml ? : {t.val})}

{ !disableImages && post.images.length > 0 &&
1 ? "mt-4 grid grid-cols-2 gap-2" : "mt-4"}> { post.images.map((image: { thumb: string | undefined; alt: string | undefined; }) => handleModalContent(e, image)} target={linkTarget} rel={linkTarget === '_blank' ? 'noopeener' : ''} > {image.alt} )}
} { !disableVideos && post.video &&
} { post.card && { post.card.thumb && !disableImages && Post Thumbnail }

{new URL(post.card.uri).hostname}

{post.card.title}

{post.card.description}

} { post.replyPost && }
} export default BskyPost;