"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TestInputTextSection = TestInputTextSection;
exports.default = void 0;

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _styles = require("@material-ui/core/styles");

var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));

var _core = require("@material-ui/core");

var useStyles = function useStyles(props) {
  return (0, _styles.makeStyles)(function (theme) {
    return {
      singleSection: {
        maxWidth: '150px' // [theme.breakpoints.up('xs')]: {
        //   maxWidth: '200px',
        // },
        // [theme.breakpoints.up('sm')]: {
        //   maxWidth: '250px',
        // },

      }
    };
  });
};

function TestInputTextSection(_ref) {
  var children = _ref.children,
      props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
  var classes = useStyles(props)();
  var theme = (0, _styles.useTheme)();
  return /*#__PURE__*/_react.default.createElement(_Grid.default, {
    container: true,
    direction: "row",
    spacing: 2,
    style: {
      justifyContent: "center"
    }
  }, props.testInputsList.map(function (elem) {
    return /*#__PURE__*/_react.default.createElement(_Grid.default, {
      item: true,
      container: true,
      direction: "column",
      spacing: 1,
      className: classes.singleSection
    }, /*#__PURE__*/_react.default.createElement(_Grid.default, {
      item: true,
      container: true,
      direction: "row",
      justifyContent: "center",
      spacing: 1,
      style: {
        flexWrap: "nowrap"
      }
    }, props.testInputsList.length !== 1 ? /*#__PURE__*/_react.default.createElement(_Grid.default, {
      item: true
    }, /*#__PURE__*/_react.default.createElement(_core.Typography, null, /*#__PURE__*/_react.default.createElement("b", null, /*#__PURE__*/_react.default.createElement("strong", null, elem.label, ":")))) : null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
      item: true
    }, elem.inputText)), props.submitted ? /*#__PURE__*/_react.default.createElement(_Grid.default, {
      item: true
    }, /*#__PURE__*/_react.default.createElement(_core.Typography, null, "\u0412\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u044C: ", /*#__PURE__*/_react.default.createElement("b", null, /*#__PURE__*/_react.default.createElement("span", {
      style: {
        color: theme.palette.alternative.green
      }
    }, " ", elem.correctAnswer)), " "), " ") : null);
  }));
}

var _default = TestInputTextSection;
exports.default = _default;