text: import {
    BrowserRouter as Router,
    Route,
    Switch,
    useRouteMatch,
  } from "react-router-dom";
  import User from "pages/[profile]";
  import NewCategory from "pages/[profile]/new";
  import Category from "pages/[profile]/[category]";
  import ProfileLayout from "components/base/ProfileLayout";
  import CategoryRouter from "./CategoryRouter";
  import SettingProfile from "pages/settings/profile";
  import Categories from "pages/[profile]/category";
  import Articles from "pages/[profile]/articles";
  
  export default function UserRouter() {
    let { path } = useRouteMatch();
  
    return (
      <Switch>
        <Route exact path={`${path}`}>
          <User />
        </Route>
        <Route exact path={`${path}/categories`}>
          <Categories />
        </Route>
        <Route exact path={`${path}/categories`}>
          <Categories />
        </Route>
        <Route exact path={`${path}/articles`}>
          <Articles />
        </Route>
        <Route exact path={`${path}/new`}>
          <NewCategory />
        </Route>
        <Route exact path={`${path}/edit`}>
          <SettingProfile />
        </Route>
        <Route path={`${path}/:category_name`}>
          <CategoryRouter />
        </Route>
      </Switch>
    );
  }
  