import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { useAuth } from "../contexts/AuthContext";
import ProtectedRoute from "../components/ProtectedRoute";

export default function ProfilePage() {
  const { t } = useTranslation();
  const { user } = useAuth();

  const content = (
    <section className="profile-page">
      <h1>{t("profile.title")}</h1>
      {user && (
        <p className="profile-phone">
          {user.phone_number || user.email || t("profile.noContact")}
        </p>
      )}
      <Link to="/bookings" className="book-cta">
        {t("profile.myBookings")}
      </Link>
    </section>
  );

  return <ProtectedRoute>{content}</ProtectedRoute>;
}
