import "./global.css";

import { Toaster } from "@/components/ui/toaster";
import { createRoot } from "react-dom/client";
import { Toaster as Sonner } from "@/components/ui/sonner";
import { TooltipProvider } from "@/components/ui/tooltip";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Index from "./pages/Index";
import NotFound from "./pages/NotFound";
import { PlaceholderPage } from "./pages/PlaceholderPage";

const queryClient = new QueryClient();

const App = () => (
  <QueryClientProvider client={queryClient}>
    <TooltipProvider>
      <Toaster />
      <Sonner />
      <BrowserRouter>
        <Routes>
          <Route path="/" element={<Index />} />

          {/* Product pages */}
          <Route
            path="/personal-loan"
            element={
              <PlaceholderPage title="Personal Loan" description="Get instant personal loan with minimal documentation" />
            }
          />
          <Route
            path="/two-wheeler-loan"
            element={
              <PlaceholderPage title="Two Wheeler Loan" description="Easy loan for your dream two-wheeler" />
            }
          />
          <Route
            path="/property-loan"
            element={
              <PlaceholderPage title="Loan Against Property" description="Get loan up to 75 lakhs against your property" />
            }
          />
          <Route
            path="/car-loan"
            element={
              <PlaceholderPage title="Used Car Loan" description="Finance your pre-owned car easily" />
            }
          />
          <Route
            path="/gold-loan"
            element={
              <PlaceholderPage title="Gold Loan" description="Get instant loan against your gold" />
            }
          />
          <Route
            path="/home-appliances"
            element={
              <PlaceholderPage title="Home Appliances on EMI" description="Get home appliances on flexible EMIs" />
            }
          />

          {/* Info pages */}
          <Route
            path="/eligibility"
            element={
              <PlaceholderPage title="Check Your Eligibility" description="Find out if you're eligible for our loans" />
            }
          />
          <Route
            path="/shop-locator"
            element={
              <PlaceholderPage title="Shop Locator" description="Find the nearest Home Credit store" />
            }
          />
          <Route
            path="/about"
            element={
              <PlaceholderPage title="About Us" description="Learn more about Home Credit" />
            }
          />
          <Route
            path="/contact"
            element={
              <PlaceholderPage title="Contact Us" description="Get in touch with our customer support" />
            }
          />
          <Route
            path="/careers"
            element={
              <PlaceholderPage title="Careers" description="Join our team at Home Credit" />
            }
          />
          <Route
            path="/blog"
            element={
              <PlaceholderPage title="Blog" description="Read our latest financial tips and articles" />
            }
          />
          <Route
            path="/download-app"
            element={
              <PlaceholderPage title="Download App" description="Get the Home Credit Mobile App" />
            }
          />
          <Route
            path="/apply"
            element={
              <PlaceholderPage title="Apply Now" description="Start your loan application" />
            }
          />

          {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
          <Route path="*" element={<NotFound />} />
        </Routes>
      </BrowserRouter>
    </TooltipProvider>
  </QueryClientProvider>
);

createRoot(document.getElementById("root")!).render(<App />);
