
import { createRoot } from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { Toaster } from "./components/ui/sonner";
import App from "./App.tsx";
import { VibePage } from "./pages/VibePage.tsx";
import { SpotifyCallback } from "./pages/SpotifyCallback.tsx";
import Alert from "./utils/alert";
import "./index.css";

// Alert를 전역으로 사용 가능하도록 설정
if (typeof window !== 'undefined') {
  (window as any).Alert = Alert;
}

createRoot(document.getElementById("root")!).render(
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<App />} />
      <Route path="/vibe" element={<VibePage />} />
      <Route path="/callback/spotify" element={<SpotifyCallback />} />
    </Routes>
    <Toaster position="top-center" richColors />
  </BrowserRouter>
);
  