import ImageViewing from 'react-native-image-viewing';

type ZoomImageModalProps = {
  uri: string | null;
  visible: boolean;
  onClose: () => void;
};

export function ZoomImageModal({ uri, visible, onClose }: ZoomImageModalProps) {
  const safeUri = typeof uri === 'string' ? uri : null;
  if (!visible || !safeUri) return null;
  return (
    <ImageViewing
      images={[{ uri: safeUri }]}
      imageIndex={0}
      visible
      onRequestClose={onClose}
    />
  );
}
