<commit_before>import Alert from 'reactstrap/lib/Alert';
import Card from 'reactstrap/lib/Card';
import CardBody from 'reactstrap/lib/CardBody';
import CardFooter from 'reactstrap/lib/CardFooter';
import CardHeader from 'reactstrap/lib/CardHeader';
import FontAwesome from 'react-fontawesome';
import moment from 'moment-timezone';
import PropTypes from 'prop-types';
import React from 'react';

import { Order } from '../../proptypes';

import Button from '../../components/Button';
import Flex from '../../components/Flex';
import Message from '../../containers/Message';
import OrderPaymentStatus from './OrderPaymentStatus';
import OrderStatusLabel from './OrderStatusLabel';
import OrderTimeout from './OrderTimeout';
import PaymentDetails from './PaymentDetails';
import Price from '../../components/Price';
import Prop from '../../components/Prop';
import RegisterButton from './RegisterButton';
import SignupCountdown from '../../years/containers/SignupCountdown';

const RegistrationStatus = ({
  activeOrder,
  onCancel,
  onConfirm,
  registrationsCloseDate,
}) => {
  if (!activeOrder) {
    if (!moment().isBefore(registrationsCloseDate)) {
      return (
        <Alert color="warning">
          <Message name="orders.registrationClosed" />
        </Alert>
      );
    }
    return (
      <div className="text-center">
        <Alert color="warning">
          <Message name="orders.notRegisteredToWorkshop" />
        </Alert>
        <p><SignupCountdown /></p>
        <RegisterButton />
      </div>
    );
  }

  return (
    <Card className="mb-4">
      <CardHeader>
        <Flex justify="between">
          <span>
            <FontAwesome name="info-circle" />
            {' '}
            <Message name="orders.status" />
          </span>
          <Button
            color="danger"
            icon="ban"
            link
            onClick={onCancel}
          >
            <Message name="orders.cancel" />
          </Button>
        </Flex>
      </CardHeader>
      <CardBody>
        <ul className="list-unstyled"><commit_msg>Hide cancel button for paid orders<commit_after>import Alert from 'reactstrap/lib/Alert';
import Card from 'reactstrap/lib/Card';
import CardBody from 'reactstrap/lib/CardBody';
import CardFooter from 'reactstrap/lib/CardFooter';
import CardHeader from 'reactstrap/lib/CardHeader';
import FontAwesome from 'react-fontawesome';
import moment from 'moment-timezone';
import PropTypes from 'prop-types';
import React from 'react';

import { Order } from '../../proptypes';

import Button from '../../components/Button';
import Flex from '../../components/Flex';
import Message from '../../containers/Message';
import OrderPaymentStatus from './OrderPaymentStatus';
import OrderStatusLabel from './OrderStatusLabel';
import OrderTimeout from './OrderTimeout';
import PaymentDetails from './PaymentDetails';
import Price from '../../components/Price';
import Prop from '../../components/Prop';
import RegisterButton from './RegisterButton';
import SignupCountdown from '../../years/containers/SignupCountdown';

const RegistrationStatus = ({
  activeOrder,
  onCancel,
  onConfirm,
  registrationsCloseDate,
}) => {
  if (!activeOrder) {
    if (!moment().isBefore(registrationsCloseDate)) {
      return (
        <Alert color="warning">
          <Message name="orders.registrationClosed" />
        </Alert>
      );
    }
    return (
      <div className="text-center">
        <Alert color="warning">
          <Message name="orders.notRegisteredToWorkshop" />
        </Alert>
        <p><SignupCountdown /></p>
        <RegisterButton />
      </div>
    );
  }

  return (
    <Card className="mb-4">
      <CardHeader>
        <Flex justify="between">
          <span>
            <FontAwesome name="info-circle" />
            {' '}
            <Message name="orders.status" />
          </span>
          {!activeOrder.paid ? (
            <Button
              color="danger"
              icon="ban"
              link
              onClick={onCancel}
            >
              <Message name="orders.cancel" />
            </Button>
          ) : null}
        </Flex>
      </CardHeader>
      <CardBody>
        <ul className="list-unstyled">
{'fraction_non_alphanumeric': 0.14170616113744075, 'fraction_numerical': 0.00047393364928909954, 'mean_word_length': 2.520433694745621, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 57, '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': '1597', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1132, 'n_words': 280}