import React from 'react';
import {
	ProgressViewIOS,
	ProgressBarAndroid,
	Platform,
} from 'react-native';
import {
	color,
} from 'nixplay-ui-kit';
import _ from 'lodash';
import PropTypes from 'prop-types';

const isIOS = _.isEqual(Platform.OS, 'ios');

export const ProgressBar = (props) => (
	isIOS ?
		<ProgressViewIOS
			progress={props.progress}
			progressTintColor={color.blue}
		/> :
		<ProgressBarAndroid
			styleAttr="Horizontal"
			indeterminate={false}
			progress={props.progress}
			color={color.blue}
		/>
);

ProgressBar.propTypes = {
	progress: PropTypes.number,
};

ProgressBar.defaultProps = {
	progress: 0,
};
