import { useState } from "react";
import ImageModerator from "./components/ImageModerator/ImageModerator";
import Login from "./components/Login/Login";

function App() {
  const [{ apiUrl, middlewareUrl, token }, setRemote] = useState({
    apiUrl: "",
    middlewareUrl: "",
    token: "",
  });

  if (token) {
    return (
      <ImageModerator
        token={token}
        apiUrl={apiUrl}
        middlewareUrl={middlewareUrl}
      />
    );
  } else {
    return <Login setRemote={setRemote} />;
  }
}

export default App;
