import * as React from 'react';
import { Header } from '@megafon/ui-core';
import { cnCreate } from '@megafon/ui-helpers';
import "./PictureWithDescription.css";
export var pictureAlignTypes = {
  LEFT: 'left',
  RIGHT: 'right'
};
var testIdPrefix = 'PictureWithDescription';
var cn = cnCreate('mfui-picture-with-description');
var PictureWithDescription = function PictureWithDescription(_ref) {
  var rootRef = _ref.rootRef,
    className = _ref.className,
    _ref$classes = _ref.classes,
    classes = _ref$classes === void 0 ? {} : _ref$classes,
    title = _ref.title,
    pictureUrl = _ref.pictureUrl,
    _ref$pictureAlign = _ref.pictureAlign,
    pictureAlign = _ref$pictureAlign === void 0 ? 'left' : _ref$pictureAlign,
    pictureAlt = _ref.pictureAlt,
    isTextTopAlign = _ref.isTextTopAlign,
    children = _ref.children;
  return /*#__PURE__*/React.createElement("div", {
    className: cn([className, classes.root]),
    ref: rootRef
  }, /*#__PURE__*/React.createElement("div", {
    className: cn('picture', {
      align: pictureAlign
    }),
    "data-testid": "".concat(testIdPrefix, "-picture")
  }, /*#__PURE__*/React.createElement("img", {
    className: cn('img'),
    src: pictureUrl,
    alt: pictureAlt
  })), /*#__PURE__*/React.createElement("div", {
    className: cn('articles', {
      align: pictureAlign,
      'text-top-align': isTextTopAlign
    }),
    "data-testid": "".concat(testIdPrefix, "-articles")
  }, !!title && /*#__PURE__*/React.createElement(Header, {
    className: cn('title', [classes.title]),
    as: "h2"
  }, title), /*#__PURE__*/React.createElement("div", {
    className: cn('content')
  }, children)));
};
export default PictureWithDescription;