
import LandingPage from "@/components/LandingPage";
import { useEffect } from "react";
import { API_URL } from "@/lib/config";

const Index = () => {
  useEffect(() => {
    const params = new URLSearchParams(window.location.search);
    const shop = params.get('shop');
    if (shop) {
      // Immediately redirect to backend to start OAuth
      window.location.href = `${API_URL}/shopify-oauth/init?shop=${shop}`;
    }
  }, []);
  return <LandingPage />;
};

export default Index;
