Show media attachments
This commit is contained in:
parent
3909148b17
commit
514880bf0e
|
@ -0,0 +1,19 @@
|
|||
import { Entity } from 'megalodon'
|
||||
|
||||
type Props = {
|
||||
media: Array<Entity.Attachment>
|
||||
}
|
||||
export default function Media(props: Props) {
|
||||
return (
|
||||
<div className="mt-2 flex flex-wrap">
|
||||
{props.media.map((media, key) => (
|
||||
<img
|
||||
src={media.preview_url}
|
||||
className="h-36 mr-2 mb-2 rounded-md max-w-full cursor-pointer"
|
||||
alt={media.description}
|
||||
title={media.description}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -2,6 +2,7 @@ import { Avatar } from 'flowbite-react'
|
|||
import { Entity, MegalodonInterface } from 'megalodon'
|
||||
import dayjs from 'dayjs'
|
||||
import Body from './Body'
|
||||
import Media from './Media'
|
||||
import emojify from '@/utils/emojify'
|
||||
|
||||
type Props = {
|
||||
|
@ -33,6 +34,7 @@ export default function Status(props: Props) {
|
|||
</div>
|
||||
</div>
|
||||
<Body status={status} />
|
||||
<Media media={status.media_attachments} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue