import { useLanguage, useUtils } from 'ordering-components/native' import React from 'react' import { View, TouchableOpacity, StyleSheet } from 'react-native' import { OText } from '../../shared' import { ProgressContentWrapper, ProgressBar } from './styles' export const MaxSectionItem = (props: any) => { const { filters, handleChangeFilters, title, options, filter } = props const [, t] = useLanguage() const [{ parsePrice }] = useUtils(); const styles = StyleSheet.create({ maxContainer: { flexDirection: 'row', justifyContent: 'space-between' } }); const parseValue = (option: number) => { return filter === 'max_distance' ? `${option / 1000} ${t('KM', 'Km')}` : filter === 'max_eta' ? `${option} ${t('TIME_MIN', 'min')}` : parsePrice(option) } return ( {title} {options.map((option: any, i: number) => ( handleChangeFilters(filter, option)} key={option} > {option === 'default' ? `${parseValue(options[i - 1])}+` : parseValue(option)} ))} ) }