"use client" import { useState } from "react" import { Button } from "./ui/button" import { Textarea } from "./ui/textarea" import { Label } from "./ui/label" import { Star } from 'lucide-react' import { useAuth } from "@/contexts/auth-context" import Link from "next/link" interface ReviewFormProps { productId: number } export function ReviewForm({ productId }: ReviewFormProps) { const [rating, setRating] = useState(0) const [comment, setComment] = useState("") const { isLoggedIn } = useAuth() const handleSubmit = (e: React.FormEvent) => { e.preventDefault() // Here you would typically send the review data to your backend console.log("Submitting review:", { productId, rating, comment }) // Reset form after submission setRating(0) setComment("") } if (!isLoggedIn) { return (
Чтобы оставить отзыв, пожалуйста, войдите в систему.
) } return ( ) }