{
+ e.preventDefault();
+ Menu.openMenu(AttachmentMenuItems, {
+ attachment
+ });
+ }}
+ >
+ {!compact && (
+ |
+
+ |
+ )}
+
+
+ {attachment.status ? (
+ attachment.status.type === "download" ? (
+
+ ) : (
+
+ )
+ ) : attachment.failed ? (
+
+ ) : attachment.working ? (
+
+ ) : (
+
+ )}
+
+ {attachment.metadata.filename}
+
+
+ |
+
+ {attachment.isDeleting ? (
+
+ ) : attachment.dateUploaded ? (
+
+ ) : (
+
+ )}
+
+
+ {attachment.status ? (
+ <>
+ {formatBytes(attachment.status.loaded, 1)}/
+ {formatBytes(attachment.status.total, 1)}
+ >
+ ) : (
+ formatBytes(attachment.length, compact ? 1 : 2)
+ )}
+
+ {!compact && (
+
+ {attachment.dateUploaded
+ ? formatDate(attachment.dateUploaded, {
+ dateStyle: "short",
+ timeStyle: "short"
+ })
+ : "-"}
+
+ )}
+
+ );
+}
+
+type MenuActionParams = {
+ attachment: any;
+};
+
+type MenuItemValue