'use strict';

var core = require('@linaria/core');
var React = require('react');
var index = require('../../Typo/index.js');
var style = require('../style.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

const TextColumnHeaderCell = ({
  column
}) => {
  return /* @__PURE__ */ React__default.default.createElement(
    "p",
    {
      className: core.cx(index.Typo.Label.l4_regular, style.SubtitleStyle, column.subTitleColor)
    },
    column.subTitle
  );
};
const TextColumnBodyCell = ({ data, column, index: index$1 }) => {
  const text = column.displayText || data[index$1][column.key];
  const CellDescription = React.useMemo(() => {
    var _a, _b;
    const Result = (_b = (_a = column.renderDescription) == null ? void 0 : _a.call(column, {
      rowIndex: index$1,
      rowData: data[index$1]
    })) != null ? _b : null;
    return typeof Result === "string" ? /* @__PURE__ */ React__default.default.createElement("p", { className: core.cx(index.Typo.Label.l4_regular, "cell-description") }, Result) : Result;
  }, [index$1, data, column]);
  const Text = React.useMemo(
    () => /* @__PURE__ */ React__default.default.createElement("p", { className: core.cx(index.Typo.Label.l3_regular, style.BodyCellTextStyle) }, text),
    [text]
  );
  return /* @__PURE__ */ React__default.default.createElement(
    style.BodyCellTextWrapper,
    {
      className: !!CellDescription ? "with-description" : void 0
    },
    Text,
    CellDescription
  );
};

exports.TextColumnBodyCell = TextColumnBodyCell;
exports.TextColumnHeaderCell = TextColumnHeaderCell;
