<commit_before>// @flow

import type { Event } from 'app/models';
import moment from 'moment-timezone';

// Calculate diplay message for an event based on
// eventStatusType, activationTime, capacity and totalCapacity
const eventStatus = (
  event: Event,
  loggedIn: boolean = false,
  isPill: boolean = false
) => {
  const {
    registrationCount,
    totalCapacity,
    activationTime,
    isAdmitted,
    eventStatusType
  } = event;

  const future = moment().isBefore(activationTime);

  switch (eventStatusType) {
    case 'TBA':
      return 'Mer info kommer';
    case 'OPEN':
      return 'Åpent arrangement';
    case 'INFINITE':
      if (!loggedIn) {
        return 'Logg inn for å melde deg på';
      } else if (activationTime === null) {
        return 'Ingen påmeldingsrett';
      }
      return 'Åpent med påmelding';
    case 'NORMAL':<commit_msg>Display already admitted.<commit_after>// @flow

import type { Event } from 'app/models';
import moment from 'moment-timezone';

// Calculate diplay message for an event based on
// eventStatusType, activationTime, capacity and totalCapacity
const eventStatus = (
  event: Event,
  loggedIn: boolean = false,
  isPill: boolean = false
) => {
  const {
    registrationCount,
    totalCapacity,
    activationTime,
    isAdmitted,
    eventStatusType
  } = event;

  const future = moment().isBefore(activationTime);

  switch (eventStatusType) {
    case 'TBA':
      return 'Mer info kommer';
    case 'OPEN':
      return 'Åpent arrangement';
    case 'INFINITE':
      if (!loggedIn) {
        return 'Logg inn for å melde deg på';
      } else if (activationTime === null) {
        if (isAdmitted) {
          return 'Du er allerede påmeldt';
        }
        return 'Ingen påmeldingsrett';
      }
      return 'Åpent med påmelding';
    case 'NORMAL':
{'fraction_non_alphanumeric': 0.10509031198686371, 'fraction_numerical': 0.0, 'mean_word_length': 2.8646934460887947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4788983', 'n_tokens_mistral': 551, 'n_tokens_neox': 540, 'n_words': 172}