import React, { Component } from 'react';
import { Text, View } from 'react-native';
import { ReviewIndicator } from './ReviewIndicator';
import { style as S } from '../styles/ReviewsSummary';
import FSI18n, { translationKeys } from '@brandingbrand/fsi18n';
export class ReviewsSummary extends Component {
    render() {
        const { value, count, style, base = 5, recommend, reviewIndicatorProps = {}, countStyle, averageStyle, recommendStyle, rowStyle, hideReviewIndicatorSubtitle, reviewIndicatorSubtitle, reviewIndicatorRowStyle, reviewIndicatorTitleText, reviewIndicatorTitleTextStyle } = this.props;
        const numberFormatting = { maximumFractionDigits: 1 };
        const reviewIndicatorCopy = reviewIndicatorSubtitle ? reviewIndicatorSubtitle :
            'based on ' + count + ' reviews';
        return (<View style={[S.container, style]}>
        <View style={[S.row, rowStyle, reviewIndicatorRowStyle]}>
          {reviewIndicatorTitleText && (<Text style={reviewIndicatorTitleTextStyle}>{reviewIndicatorTitleText}</Text>)}
          <ReviewIndicator value={value} {...reviewIndicatorProps}/>
          <Text style={[S.averageStyle, averageStyle]}>
            {FSI18n.number(value, numberFormatting)} / {FSI18n.number(base, numberFormatting)}
          </Text>
        </View>
        {!hideReviewIndicatorSubtitle && (<View style={[S.row, rowStyle]}>
            <Text style={[S.countStyle, countStyle]}>{reviewIndicatorCopy}</Text>
          </View>)}
        {recommend && (<View style={[S.row, rowStyle]}>
          <Text style={[S.recommendStyle, recommendStyle]}>
            {FSI18n.string(translationKeys.flagship.reviews.recommendCount, {
            recommendPercent: recommend
        })}
          </Text>
        </View>)}
      </View>);
    }
}
//# sourceMappingURL=ReviewsSummary.js.map