/* global React */

function LegalPage({ type, onNavigate }) {
  const isPrivacy = type === "privacy";
  return (
    <div>
      <section className="ws-hero ws-hero--split" style={{ minHeight: 520 }}>
        <div className="ws-hero__copy">
          <div className="ws-hero__eyebrow">{isPrivacy ? "Privacy" : "Terms"}</div>
          <h1 className="ws-hero__title">{isPrivacy ? "Privacy Policy" : "Terms & Conditions"}</h1>
          <p className="ws-hero__body">
            {isPrivacy
              ? "How enquiry and booking request details are handled by 59 William Street."
              : "The basic terms for booking enquiries and stays at 59 William Street."}
          </p>
        </div>
        <div className="ws-hero__bg" style={{ backgroundImage: `url(${window.WS_PHOTO_SRC("livingRoom1", 1)})` }} />
      </section>

      <section className="ws-section ws-on-cream">
        <div className="ws-container" style={{ maxWidth: 920 }}>
          <SectionOpener
            align="left"
            eyebrow="59 William Street"
            title={isPrivacy ? "Your information" : "Booking directly"}
          />
          {isPrivacy ? (
            <div>
              <p>When you send a message or booking request, we collect the details you provide: name, email address, phone number, dates, guest count and message content.</p>
              <p>These details are used only to respond to your enquiry, manage availability and prepare your stay. They are not sold or shared for advertising.</p>
              <p>Booking request data is stored securely by the website host and reviewed by the property host, {window.SITE_CONTACT.hostedBy}. To ask about your data, contact {window.SITE_CONTACT.email}.</p>
            </div>
          ) : (
            <div>
              <p>Submitting a booking request does not confirm a stay automatically. We will review availability and reply with confirmation details by email.</p>
              <p>Payment, cancellation and deposit terms will be confirmed before a booking is accepted. Online payment will be added after the payment account is ready.</p>
              <p>The Airbnb listing sets the current stay basics as check-in after 16:00, checkout before 10:00 and a maximum of 10 guests. Guests are expected to respect the house, neighbours and local rules.</p>
              <p>Check-in instructions and house guidance are provided before arrival.</p>
            </div>
          )}
          <button className="ws-btn ws-btn--ghost" style={{ color:"var(--ws-gold-deep)", borderColor:"var(--ws-gold-deep)", marginTop: 24 }} onClick={() => onNavigate("contact")}>
            Contact Us
          </button>
        </div>
      </section>
    </div>
  );
}

window.LegalPage = LegalPage;
