'use client';
import { useState } from "react";

export default function SelectRate({ onChange, value }) {
   return <div className="flex">
      {[1, 2, 3, 4, 5].map((star) => (
         <span
            key={star}
            onClick={() => onChange(star)}
            style={{
               cursor: "pointer",
               color: star <= value ? "gold" : "gray",
               fontSize: "1.5rem",
            }}
         >
            ★
         </span>
      ))}
   </div>
}

