Оставить отзыв
{/* Rating stars */}Отличный опыт работы! Рекомендую.
"use client"; import { useState } from "react"; import Link from "next/link"; import { Button } from "@/components/ui/button"; export default function ReviewsPage() { const [rating, setRating] = useState(0); const [comment, setComment] = useState(""); const [loading, setLoading] = useState(false); const [success, setSuccess] = useState(false); async function handleSubmit() { if (rating === 0) return; setLoading(true); try { await fetch("/api/reviews", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ project_id: "123", reviewee_id: "456", rating, comment }), }); setSuccess(true); } catch (err) { console.error(err); } finally { setLoading(false); } } return (
Отличный опыт работы! Рекомендую.