import React from 'react'
import { BusinessReviews as BusinessReviewController, useLanguage } from 'ordering-components/native'
import IconAntDesign from 'react-native-vector-icons/AntDesign'
import { BusinessBasicInformation } from '../BusinessBasicInformation'
import { View, StyleSheet } from 'react-native'
import { OText } from '../shared'
import {
BusinessReviewsContainer,
ScoreView,
BusinessReviewContent,
WrapCustomerReview,
WrapCustomerReviewTotal
} from './styles'
import { ScrollView } from 'react-native-gesture-handler'
import { GrayBackground } from '../BusinessInformation/styles'
import { BusinessReviewsParams } from '../../types'
import { useTheme } from 'styled-components/native'
const BusinessReviewsUI = (props: BusinessReviewsParams) => {
const {
businessState,
reviewsList,
} = props
const theme = useTheme();
const [, t] = useLanguage();
const Score = ({ star, text }: any) => (
{star}
{text}
)
return (
{reviewsList.error ? (
{t('ERROR_UNKNOWN', 'An error has ocurred')}
) : (
<>
{t('CUSTOMERS_REVIEWS', 'Customers Reviews')}
{reviewsList?.reviews.map((review: any) =>(
{review.total}
{review.comment}
))}
>
)}
{!reviewsList.loading && reviewsList?.reviews.length === 0 && (
{t('REVIEWS_NOT_FOUND', 'Reviews Not Found')}
)}
)
}
const styles = StyleSheet.create({
starIcon: {
marginRight: 5,
},
reviewScoreStyle: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
},
wrapTotalScoresStyle: {
maxHeight: 80,
height: 80,
marginBottom: 20
}
})
export const BusinessReviews = (props: any) => {
const BusinessReviewProps = {
...props,
UIComponent: BusinessReviewsUI
}
return
}