import React, { useState } from "react"; import { RatingType } from "../types"; type Props = { element: RatingType; }; export const ARatingForm = ({ element }: Props) => { const [selectedchoice, setSelectedchoice] = useState(""); function buttonClick(event: React.MouseEvent) { event.preventDefault(); setSelectedchoice(event.currentTarget.name); } return (
{element.content.choices.map((choice) => (
))}
); };