import { Navigate, useLocation } from "react-router-dom";
import Routers from "./Routers";
import Toaster from "./components/Helpers/Toaster";
import Default from "./components/Partials/Default";

function App() {
  const { pathname } = useLocation();
  return (
    <Default>
      <>
        {pathname.startsWith("/@") ? (
          <Navigate to="/app" replace={true} />
        ) : (
          <Routers />
        )}
        <Toaster />
      </>
    </Default>
  );
}

export default App;
