import React from "react";
import { View, Text, Dimensions, Pressable } from "react-native";
import { Rating } from "react-native-ratings";
import { connect } from "react-redux";
import { vote } from "../../../redux/actions";
import { asyncAwesomeAlert } from "../../../utils/AsyncWrappers";
//assets
import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
const width = Dimensions.get("window").width;
function Rates({ rate, productId, addVote, isBuyed = null, theme }) {
return (
!isBuyed
? asyncAwesomeAlert("خطا", "شما این محصول رو خریداری نکرده اید.", {
showCancelButton: false,
})
: {}
}
>
{rate}
addVote({ productId, vote: rating })}
readonly={!isBuyed}
/>
{`از بین ${1150} نفر`}
{[
{ name: "بخش ۱", value: 40 },
{ name: "بخش ۱", value: 20 },
{ name: "بخش ۱", value: 70 },
{ name: "بخش ۱", value: 10 },
{ name: "بخش ۱", value: 50 },
].map((field, index) => (
))}
);
}
const Progress = ({ data,theme, ...props }) => {
return (
{data.name}
{data.value + "%"}
);
};
const mapStateToProps = (state) => ({
theme: state.publicApi.theme
});
const mapDispatchToProps = {
addVote: vote.add,
};
export default connect(mapStateToProps, mapDispatchToProps)(Rates);