"use client";
import { useSearchParams } from "next/navigation";
import {Button} from "@mui/material";
import { useRouter } from 'next/navigation'

export default function SuccessContent() {
  const params = useSearchParams();
  const store = params.get("store");
  const router = useRouter();

  return (
    <div className="flex items-center justify-center h-screen">
      <div className="bg-white w-full max-w-[500px] shadow-lg p-8 rounded-xl text-center">
        <h1 className="text-2xl font-bold text-green-600">
          🎉 Amazon Store Connected
        </h1>
        <p className="my-4">
          Store: <strong>{store}</strong>
        </p>
        <Button
            onClick={() => router.push('/amazon-api-user-dashboard')}
            type="button"
            variant="contained"
            className="text-white px-8 py-1.5 rounded-full"
            sx={{ backgroundColor: "#c4262e", borderRadius: 50 }}
          >
            Go to dashboard
          </Button>
      </div>
    </div>
  );
}