<commit_before>// @flow

import { Component } from 'react';
import { Link, NavLink } from 'react-router-dom';
import Modal from 'app/components/Modal';
import Time from 'app/components/Time';
import EventEditor from './EventEditor';
import styles from './Toolbar.css';
import type { ActionGrant } from 'app/models';
import cx from 'classnames';

type Props = {
  actionGrant: ActionGrant,
};

type State = {
  editorOpen: boolean,
};

class Toolbar extends Component<Props, State> {
  state = {
    editorOpen: false,
  };

  render() {
    const { actionGrant } = this.props;
    return (
      <div className={styles.root}>
        <div className={styles.time}>
          <Time format="ll" className={styles.timeNow} />
        </div>

        <NavLink
          exact
          to="/events"
          activeClassName={styles.active}
          className={cx(styles.pickerItem, styles.list)}
        >
          Liste
        </NavLink>

        <NavLink
          to="/events/calendar"
          activeClassName={styles.active}
          className={cx(styles.pickerItem, styles.calender)}
        >
          Kalender
        </NavLink>

        <div className={styles.create}>
          {actionGrant?.includes('create') && (
            <Link to="/events/create">Lag nytt</Link>
          )}
        </div>

        <Modal
          keyboard={false}
          show={this.state.editorOpen}
          onHide={() => this.setState({ editorOpen: false })}
          closeOnBackdropClick={false}
        >
          <EventEditor />
        </Modal>
      </div>
    );
  }
}

export default Toolbar;<commit_msg>Remove unused code to make Toolbar functional<commit_after>// @flow

import { Link, NavLink } from 'react-router-dom';
import Time from 'app/components/Time';
import styles from './Toolbar.css';
import type { ActionGrant } from 'app/models';
import cx from 'classnames';

type Props = {
  actionGrant: ActionGrant,
};

const Toolbar = ({ actionGrant }: Props) => (
  <div className={styles.root}>
    <div className={styles.time}>
      <Time format="ll" className={styles.timeNow} />
    </div>

    <NavLink
      exact
      to="/events"
      activeClassName={styles.active}
      className={cx(styles.pickerItem, styles.list)}
    >
      Liste
    </NavLink>

    <NavLink
      to="/events/calendar"
      activeClassName={styles.active}
      className={cx(styles.pickerItem, styles.calender)}
    >
      Kalender
    </NavLink>

    <div className={styles.create}>
      {actionGrant?.includes('create') && (
        <Link to="/events/create">Lag nytt</Link>
      )}
    </div>
  </div>
);

export default Toolbar;
{'fraction_non_alphanumeric': 0.1416635017090771, 'fraction_numerical': 0.0, 'mean_word_length': 2.4207792207792207, 'pattern_counts': {'":': 0, '<': 33, '<?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': '6945857', 'n_tokens_mistral': 783, 'n_tokens_neox': 766, 'n_words': 172}