<commit_before>import {
  createStyles,
  Theme,
  withStyles,
  WithStyles
} from "@material-ui/core/styles";
import * as React from "react";

import Link from "../../../components/Link";
import Money from "../../../components/Money";
import Skeleton from "../../../components/Skeleton";
import i18n from "../../../i18n";
import { maybe } from "../../../misc";
import { OrderDetails_order } from "../../types/OrderDetails";

const styles = (theme: Theme) =>
  createStyles({
    root: {
      ...theme.typography.body1,
      lineHeight: 1.9,
      width: "100%"
    },
    textRight: {
      textAlign: "right"
    }
  });

interface OrderDraftDetailsSummaryProps extends WithStyles<typeof styles> {
  order: OrderDetails_order;
  onShippingMethodEdit: () => void;
}

const OrderDraftDetailsSummary = withStyles(styles, {
  name: "OrderDraftDetailsSummary"
})(
  ({ classes, order, onShippingMethodEdit }: OrderDraftDetailsSummaryProps) => (
    <table className={classes.root}>
      <tbody>
        <tr>
          {maybe(() => order.subtotal) ? (
            <>
              <td>{i18n.t("Subtotal")}</td>
              <td className={classes.textRight}>
                <Money money={order.subtotal.gross} />
              </td>
            </>
          ) : (
            <td colSpan={2}>
              <Skeleton />
            </td>
          )}
        </tr>
        <tr>
          {maybe(() => order.shippingMethod) !== undefined ? (
            <>
              <td>
                <Link onClick={onShippingMethodEdit}>
                  {maybe(() => order.shippingMethodName)
                    ? order.shippingMethodName
                    : i18n.t("Add Shipping Carrier")}
                </Link>
              </td>
              <td className={classes.textRight}>
                {maybe(() => order.shippingPrice) ? (
                  <Money money={order.shippingPrice.gross} />
                ) : (
                  "---"
                )}
              </td>
            </>
          ) : (
            <td colSpan={2}><commit_msg>Disable shipping method choice if no method is applicable<commit_after>import {
  createStyles,
  Theme,
  withStyles,
  WithStyles
} from "@material-ui/core/styles";
import * as React from "react";

import Link from "../../../components/Link";
import Money from "../../../components/Money";
import Skeleton from "../../../components/Skeleton";
import i18n from "../../../i18n";
import { maybe } from "../../../misc";
import { OrderDetails_order } from "../../types/OrderDetails";

const styles = (theme: Theme) =>
  createStyles({
    root: {
      ...theme.typography.body1,
      lineHeight: 1.9,
      width: "100%"
    },
    textRight: {
      textAlign: "right"
    }
  });

interface OrderDraftDetailsSummaryProps extends WithStyles<typeof styles> {
  order: OrderDetails_order;
  onShippingMethodEdit: () => void;
}

const OrderDraftDetailsSummary = withStyles(styles, {
  name: "OrderDraftDetailsSummary"
})(
  ({ classes, order, onShippingMethodEdit }: OrderDraftDetailsSummaryProps) => (
    <table className={classes.root}>
      <tbody>
        <tr>
          {maybe(() => order.subtotal) ? (
            <>
              <td>{i18n.t("Subtotal")}</td>
              <td className={classes.textRight}>
                <Money money={order.subtotal.gross} />
              </td>
            </>
          ) : (
            <td colSpan={2}>
              <Skeleton />
            </td>
          )}
        </tr>
        <tr>
          {order &&
          order.shippingMethod !== undefined &&
          order.shippingMethodName !== undefined ? (
            order.shippingMethod === null ? (
              order.availableShippingMethods &&
              order.availableShippingMethods.length > 0 ? (
                <td>
                  <Link onClick={onShippingMethodEdit}>
                    {i18n.t("Add shipping carrier")}
                  </Link>
                </td>
              ) : (
                <td>{i18n.t("No applicable shipping carriers")}</td>
              )
            ) : (
              <>
                <td>
                  <Link onClick={onShippingMethodEdit}>
                    {order.shippingMethodName}
                  </Link>
                </td>
                <td className={classes.textRight}>
                  {maybe(() => order.shippingPrice) ? (
                    <Money money={order.shippingPrice.gross} />
                  ) : (
                    "---"
                  )}
                </td>
              </>
            )
          ) : (
            <td colSpan={2}>
{'fraction_non_alphanumeric': 0.15274151436031333, 'fraction_numerical': 0.007615317667536988, 'mean_word_length': 1.5079105291871249, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 74, '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': '1700335', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1260, 'n_words': 239}