- {currentItem.kind === "video" ? (
-
- ) : currentItem.kind === "motion" ? (
-
- ) : (
-

- )}
+
{
+ if (event.target === event.currentTarget) {
+ handleClose();
+ }
+ }}
+ >
+
event.stopPropagation()}>
+ {currentItem.kind === "video" ? (
+
+ ) : currentItem.kind === "motion" ? (
+
+ ) : (
+

+ )}
+
- {/* Screen reader description */}
+ {hasMultiple && sm && (
+ <>
+
}
+ />
+
}
+ />
+ >
+ )}
+
+ {hasMultiple && !sm && (
+
+
+
+
+ {safeIndex + 1} / {itemCount}
+
+
+
+
+ )}
+
- Attachment preview dialog. Press Escape to close or click outside the media.
+ Attachment preview dialog. Press Escape to close and use left or right arrow keys to switch items.
);
}
+interface NavButtonProps {
+ side: "left" | "right";
+ disabled: boolean;
+ label: string;
+ onClick: () => void;
+ icon: React.ReactNode;
+}
+
+const NavButton = ({ side, disabled, label, onClick, icon }: NavButtonProps) => (
+
+);
+
export default PreviewImageDialog;