"use client";

import { useEffect } from "react";
import Container from "@/components/ui/Container";
import { ButtonLink } from "@/components/ui/Button";
import { clearStoredCart } from "@/lib/store-api";

export default function CheckoutSuccessPage() {
  useEffect(() => {
    clearStoredCart();
  }, []);

  return (
    <section className="py-24">
      <Container className="max-w-lg mx-auto text-center">
        <h1 className="font-display text-3xl text-neutral-900">Thank you for your order!</h1>
        <p className="mt-4 text-neutral-600">
          Your payment was successful and your order is being processed. A confirmation email is on its way.
        </p>
        <div className="mt-8">
          <ButtonLink href="/products">Continue Shopping</ButtonLink>
        </div>
      </Container>
    </section>
  );
}
