feat: blurhash

This commit is contained in:
codytseng
2025-01-08 16:54:10 +08:00
parent 91977d6495
commit dacaa4a75d
15 changed files with 155 additions and 50 deletions

View File

@@ -1,5 +1,7 @@
import { extractImetaUrlFromTag } from '@/lib/tag'
import { isNsfwEvent } from '@/lib/event'
import { extractImageInfoFromTag } from '@/lib/tag'
import { cn } from '@/lib/utils'
import { TImageInfo } from '@/types'
import { Event } from 'nostr-tools'
import { memo, ReactNode } from 'react'
import {
@@ -11,14 +13,13 @@ import {
embeddedWebsocketUrlRenderer
} from '../Embedded'
import { ImageCarousel } from '../ImageCarousel'
import { isNsfwEvent } from '@/lib/event'
const PictureContent = memo(({ event, className }: { event: Event; className?: string }) => {
const images: string[] = []
const images: TImageInfo[] = []
event.tags.forEach((tag) => {
const imageUrl = extractImetaUrlFromTag(tag)
if (imageUrl) {
images.push(imageUrl)
const imageInfo = extractImageInfoFromTag(tag)
if (imageInfo) {
images.push(imageInfo)
}
})
const isNsfw = isNsfwEvent(event)