"use client";

import { useState } from "react";
import { GuideRatingList } from "@/components/guides/guide-rating-list";
import { GuideReviewForm } from "@/components/guides/guide-review-form";

type GuideReviewsSectionProps = {
  guideUuid: string;
};

export function GuideReviewsSection({ guideUuid }: GuideReviewsSectionProps) {
  const [refreshKey, setRefreshKey] = useState(0);

  return (
    <>
      <GuideRatingList guideUuid={guideUuid} refreshKey={refreshKey} />
      <GuideReviewForm
        userUuid={guideUuid}
        onReviewSubmitted={() => setRefreshKey((value) => value + 1)}
      />
    </>
  );
}
