- {sensitive ? (
-
- ) : (
-
- )}
-
-
- {props.media.map((media, key) => (
-
- ))}
+ if (props.media.length > 0) {
+ return (
+
+ {sensitive ? (
+
+ ) : (
+ <>
+
+
+ {props.media.map((media, key) => (
+
+ ))}
+
+ >
+ )}
-
- )
+ )
+ } else {
+ return null
+ }
}
type AttachmentProps = {
attachment: Entity.Attachment
- sensitive: boolean
}
function Attachment(props: AttachmentProps) {
- if (props.sensitive) {
- return (
-
- )
- } else {
- return (
-
- )
- }
+ return (
+
+ )
}