import React from 'react'; import { useTheme } from 'styled-components/native'; import { AddressDetails as AddressDetailsController, useOrder } from 'ordering-components/native'; import { ADContainer, ADHeader, ADAddress, ADMap } from './styles'; import { OText, OIcon } from '../shared'; const AddressDetailsUI = (props: any) => { const { navigation, addressToShow, isCartPending, googleMapsUrl, apiKey, showMap } = props; const theme = useTheme(); const [orderState] = useOrder(); return ( {orderState?.options?.type === 1 && !isCartPending && navigation.navigate('AddressList', { isFromCheckout: true })}> {addressToShow || orderState?.options?.address?.address} } {showMap && !!apiKey && googleMapsUrl && ( )} ) } export const AddressDetails = (props: any) => { const addressDetailsProps = { ...props, UIComponent: AddressDetailsUI } return ( ) }