import { Form } from "react-router-dom"; import StarPicker from 'react-star-picker'; import "../stylesheets/shared.css"; import { useState } from "react"; function getTextArea(errors) { if(errors && errors.review) { const error_messages = errors.review.map(message =>

{message}

); return (
{error_messages}
); } return (
); } export default function ReviewForm({ product, errors }) { const [rating, setRating] = useState(0); const review_field = getTextArea(errors); const onChange = (value, name) => { setRating(value); }; return (
{review_field}
); }