fix: ReviewsPage use useAuth for slug; reviews redirect by booking source

- Replace useParams with useAuth().user.hotelSlug in ReviewsPage
- Backend: filter platforms by booking source when review_redirect_source=true
  (booking_com→Booking.com, yandex_travel→Яндекс, airbnb, expedia, vrbo)
- If source has matching platform — show only that one; otherwise all platforms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 00:21:26 +03:00
parent 6ba591928a
commit 2de9b9e27d
2 changed files with 33 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react'
import { useParams } from 'react-router-dom'
import { useAuth } from '../contexts/AuthContext'
import {
Star, ThumbsDown, Copy, CheckCheck, MessageSquare, QrCode,
ArrowUpRight, Plus, Trash2, ExternalLink, Settings2,
@@ -65,7 +65,8 @@ type Tab = 'pending' | 'published' | 'all' | 'preview' | 'settings'
// ── Component ─────────────────────────────────────────────────────────────────
export function ReviewsPage() {
const { slug } = useParams<{ slug: string }>()
const { user } = useAuth()
const slug = user?.hotelSlug ?? ''
const [reviews, setReviews] = useState<ReviewApi[]>([])
const [loading, setLoading] = useState(true)