import React, { Fragment } from "react"; import { Redirect, Route, Switch, useRouteMatch, match } from "react-router"; import { useTranslation } from "react-i18next"; import { AuthUser } from "@/services/user"; import AdminNav from "./AdminNav"; import UserAdmin from "./UserAdmin"; import MoreAdmin from "./MoreAdmin"; import "./index.css"; interface AdminProps { user: AuthUser; } const Admin: React.FC = ({ user }) => { useTranslation("admin"); const match = useRouteMatch(); return ( {(p) => { const match = p.match as match<{ name: string }>; const name = match.params["name"]; return (
{(() => { if (name === "users") { return ; } else if (name === "more") { return ; } })()}
); }}
); }; export default Admin;