2024-01-09 13:30:05 +01:00
|
|
|
import { Dialog, DialogBody } from '@material-tailwind/react'
|
2023-12-02 11:26:45 +01:00
|
|
|
import { Entity } from 'megalodon'
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
open: boolean
|
|
|
|
close: () => void
|
|
|
|
attachment: Entity.Attachment | null
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Media(props: Props) {
|
|
|
|
return (
|
2024-01-09 13:30:05 +01:00
|
|
|
<Dialog open={props.open} handler={props.close} size="lg">
|
|
|
|
<DialogBody className="max-h-full max-w-full">
|
2023-12-02 11:26:45 +01:00
|
|
|
{props.attachment && (
|
|
|
|
<img
|
|
|
|
src={props.attachment.url}
|
|
|
|
alt={props.attachment.description}
|
|
|
|
title={props.attachment.description}
|
|
|
|
className="object-contain max-h-full max-w-full m-auto"
|
|
|
|
/>
|
|
|
|
)}
|
2024-01-09 13:30:05 +01:00
|
|
|
<></>
|
|
|
|
</DialogBody>
|
|
|
|
</Dialog>
|
2023-12-02 11:26:45 +01:00
|
|
|
)
|
|
|
|
}
|