@{post.authorName}
• {formattedDate}
{post.content}
{post.media.length > 0 && (
{post.media.map((media) => (
))}
)}
)
}
interface PostMediaProps {
media: PostMedia
}
function PostMediaItem({ media }: PostMediaProps) {
const url = new URL(media.url.toString())
if (location.protocol === 'https:' && url.protocol !== 'https:') {
url.protocol = 'https:'
}
const width = media.width ?? undefined
const height = media.height ?? undefined
return (