import { Button } from 'flowbite-react' import { Entity } from 'megalodon' import { useState } from 'react' import { FaEyeSlash } from 'react-icons/fa6' import { FormattedMessage } from 'react-intl' type Props = { media: Array sensitive: boolean openMedia: (media: Entity.Attachment) => void } export default function Media(props: Props) { const [sensitive, setSensitive] = useState(props.sensitive) if (props.media.length > 0) { return (
{sensitive ? ( ) : ( <>
{props.media.map((media, key) => (
props.openMedia(media)} />
))}
)}
) } else { return null } } type AttachmentProps = { attachment: Entity.Attachment openMedia: () => void } function Attachment(props: AttachmentProps) { return ( {props.attachment.description} ) }