import { useEffect, useState } from "react"; import { useParams, Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { apiGet } from "../api/client"; export default function SalonDetailPage() { const { t } = useTranslation(); const { id } = useParams(); const [salon, setSalon] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(""); useEffect(() => { if (!id) return; apiGet(`/salons/${id}/`) .then(setSalon) .catch((err) => setError(err.message)) .finally(() => setLoading(false)); }, [id]); if (loading) return

{t("results.loading")}

; if (error) return

{error}

; if (!salon) return null; return (

{salon.name}

{salon.description || t("card.noDescription")}

{salon.city} {salon.phone_number || t("card.phoneUnavailable")}

{t("salon.services")}

{t("salon.staff")}

{t("book.cta")}
); }