feat: support for video events
This commit is contained in:
parent
d6a5a82cf8
commit
6b88da3f03
28 changed files with 116 additions and 72 deletions
18
src/components/Note/VideoNote.tsx
Normal file
18
src/components/Note/VideoNote.tsx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { getImetaInfosFromEvent } from '@/lib/event'
|
||||
import { Event } from 'nostr-tools'
|
||||
import { useMemo } from 'react'
|
||||
import Content from '../Content'
|
||||
import MediaPlayer from '../MediaPlayer'
|
||||
|
||||
export default function VideoNote({ event, className }: { event: Event; className?: string }) {
|
||||
const videoInfos = useMemo(() => getImetaInfosFromEvent(event), [event])
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<Content event={event} />
|
||||
{videoInfos.map((video) => (
|
||||
<MediaPlayer src={video.url} key={video.url} className="mt-2" />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue