<commit_before>/*
 * This file renders the AdminSideMenu component
 */
import { Layout, Menu } from "antd";
/*
 * The following import statements makes available
 * all the elements required by the component
 */
import React from "react";
import { Link } from "react-router-dom";
import { setBaseUrl } from "../../../utilities/url-utilities";
import { ADMIN } from "../routes";

const { SubMenu } = Menu;
const { Sider } = Layout;
export default function AdminHeader() {
  const [selectedKeys, setSelectedKeys] = React.useState(() => {
    // Grab it from the URL, look for where you are which
    // should be right after the admin path
    const regExp = /admin\/(\w*)\/?/i;
    const found = window.location.href.match(regExp);
    return found !== null ? found[1] : "statistics";
  });
  const DEFAULT_URL = setBaseUrl("/admin");
  // The following renders the AdminPanelSideMenu component
  return (
    <Sider width={220}>
      <section>
        <Link
          style={{ paddingLeft: 10, paddingRight: 10 }}
          to={`${DEFAULT_URL}/${ADMIN.USERS}`}
        >
          <img
            height="64"
            width="200"
            src={setBaseUrl("/resources/img/irida_logo_dark.svg")}
          />
        </Link>
        <Menu
          className={"t-admin-side-menu"}
          style={{ height: "100vh" }}
          theme={"dark"}
          mode={"inline"}
          selectedKeys={[selectedKeys]}
        >
          <Menu.Item key="statistics">
            <Link
              to={`${DEFAULT_URL}/${ADMIN.STATISTICS}`}
              onClick={() => setSelectedKeys("statistics")}
              className={"t-admin-statistics-link"}
            >
              {i18n("AdminPanel.statistics")}
            </Link>
          </Menu.Item>
          <SubMenu
            title={i18n("AdminPanel.users")}
            className={"t-admin-users-submenu"}
          >
            <Menu.Item key="users">
              <Link
                onClick={() => setSelectedKeys("users")}
                to={`${DEFAULT_URL}/${ADMIN.USERS}`}
                className={"t-admin-users-link"}
              >
                {i18n("AdminPanel.userList")}<commit_msg>Fixed strange scroll in admin panel<commit_after>/*
 * This file renders the AdminSideMenu component
 */
import { Layout, Menu } from "antd";
/*
 * The following import statements makes available
 * all the elements required by the component
 */
import React from "react";
import { Link } from "react-router-dom";
import { setBaseUrl } from "../../../utilities/url-utilities";
import { ADMIN } from "../routes";

const { SubMenu } = Menu;
const { Sider } = Layout;
export default function AdminHeader() {
  const [selectedKeys, setSelectedKeys] = React.useState(() => {
    // Grab it from the URL, look for where you are which
    // should be right after the admin path
    const regExp = /admin\/(\w*)\/?/i;
    const found = window.location.href.match(regExp);
    return found !== null ? found[1] : "statistics";
  });
  const DEFAULT_URL = setBaseUrl("/admin");
  // The following renders the AdminPanelSideMenu component
  return (
    <Sider width={220}>
      <section>
        <Link
          style={{ paddingLeft: 10, paddingRight: 10 }}
          to={`${DEFAULT_URL}/${ADMIN.USERS}`}
        >
          <img
            height="64"
            width="200"
            src={setBaseUrl("/resources/img/irida_logo_dark.svg")}
          />
        </Link>
        <Menu
          className={"t-admin-side-menu"}
          style={{ height: "calc(100vh - 65px)" }}
          theme={"dark"}
          mode={"inline"}
          selectedKeys={[selectedKeys]}
        >
          <Menu.Item key="statistics">
            <Link
              to={`${DEFAULT_URL}/${ADMIN.STATISTICS}`}
              onClick={() => setSelectedKeys("statistics")}
              className={"t-admin-statistics-link"}
            >
              {i18n("AdminPanel.statistics")}
            </Link>
          </Menu.Item>
          <SubMenu
            title={i18n("AdminPanel.users")}
            className={"t-admin-users-submenu"}
          >
            <Menu.Item key="users">
              <Link
                onClick={() => setSelectedKeys("users")}
                to={`${DEFAULT_URL}/${ADMIN.USERS}`}
                className={"t-admin-users-link"}
              >
                {i18n("AdminPanel.userList")}
{'fraction_non_alphanumeric': 0.15136249141286925, 'fraction_numerical': 0.010533547057476528, 'mean_word_length': 1.9979409746053534, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1464582', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1245, 'n_words': 281}