import React from "react";
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Login from "./login";
import Register from "./register";
import AuthenticatedRoute from "components/auth";
import { Workflows } from "components/workflows";
import {AddWorkflow} from "components/addWorkflow";
import { NotFound } from "./404";
const Pages: React.FC = () => {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Login />}>
        </Route>
        <Route path="/register" element={<Register />}>
        </Route>
        <Route path="/workflows" element={<AuthenticatedRoute element={<Workflows />} />}></Route>
        <Route path="/addWorkflow/:tableName?/:action?/:workflowId?" element={<AuthenticatedRoute element={<AddWorkflow />} />}></Route>
        <Route path="*" element={<NotFound />} />
      </Routes>
    </BrowserRouter>
  );
};

export default Pages;
