import React, { useState } from 'react'; import { useWindowDimensions, View } from 'react-native'; import { useTheme } from 'styled-components/native'; import { useLanguage } from 'ordering-components/native'; import Spinner from 'react-native-loading-spinner-overlay'; import { Title } from './styles'; import { Cart } from '../Cart'; import { NotFoundSource } from '../NotFoundSource'; import { OText } from '../shared'; export const CartContent = (props: any) => { const { carts } = props const { height } = useWindowDimensions() const theme = useTheme(); const [, t] = useLanguage() const [isCartsLoading, setIsCartsLoading] = useState(false) return ( carts?.length > 0 ? ( <> <OText size={20} style={{ marginTop: 20 }}> {carts.length > 1 ? t('MY_CARTS', 'My Carts') : t('CART', 'Cart')} </OText> {carts.map((cart: any, i: number) => ( {cart.products.length > 0 && ( <> {!(i === (carts.length - 1)) && ( )} )} ))} ) : ( <> <OText size={20}> {t('MY_CARTS', 'My Carts')} </OText> ) ) }