import PropTypes from 'prop-types' import React from 'react' import { Image, StyleSheet, View, ImageProps, ViewStyle, StyleProp, ImageStyle, ImageURISource, } from 'react-native' // TODO: support web import Lightbox, { LightboxProps } from 'react-native-lightbox-v2' import { IMessage } from './Models' import { StylePropType } from './utils' const styles = StyleSheet.create({ container: {}, image: { width: 150, height: 100, borderRadius: 13, margin: 3, resizeMode: 'cover', }, imageActive: { flex: 1, resizeMode: 'contain', }, }) export interface MessageImageProps { currentMessage?: TMessage containerStyle?: StyleProp imageSourceProps?: Partial imageStyle?: StyleProp imageProps?: Partial lightboxProps?: LightboxProps } export function MessageImage({ containerStyle, lightboxProps = {}, imageProps = {}, imageSourceProps = {}, imageStyle, currentMessage, }: MessageImageProps) { if (currentMessage == null) return null return ( ) } MessageImage.propTypes = { currentMessage: PropTypes.object, containerStyle: StylePropType, imageSourceProps: PropTypes.object, imageStyle: StylePropType, imageProps: PropTypes.object, lightboxProps: PropTypes.object, }