'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var React = require('react');
var React__default = _interopDefault(React);
var Container = _interopDefault(require('react-bootstrap/Container'));
var Row = _interopDefault(require('react-bootstrap/Row'));
var Col = _interopDefault(require('react-bootstrap/Col'));
var Card = _interopDefault(require('react-bootstrap/Card'));

var RolesDeck = function RolesDeck(props) {
  var _props$icon = props.icon,
      icon = _props$icon === undefined ? false : _props$icon,
      data = props.dataRecord;

  //   Sample
  //   <RolesDeck
  //        icon - flag to show/hide the arrow icon.
  //        dataRecord - data record to be shown in card.
  //   />

  return React__default.createElement(
    'div',
    { className: 'rolesDeck' },
    React__default.createElement(
      Container,
      null,
      React__default.createElement(
        Row,
        null,
        data && data.map(function (row, index) {
          if (row && row.url && row.name) {
            return React__default.createElement(
              Col,
              { key: index, md: 12, lg: 6, counter: index++, style: { display: 'flex', flex: '1 0 auto' } },
              React__default.createElement(
                Card,
                { className: 'taxonomy-card', style: { position: 'relative', overflow: 'hidden', borderBottom: '3px solid var(--primary)' } },
                React__default.createElement(
                  Card.Link,
                  { href: row.url },
                  React__default.createElement(
                    Card.Body,
                    null,
                    React__default.createElement(
                      Row,
                      null,
                      React__default.createElement(
                        Col,
                        { className: 'details-content-wrapper' },
                        React__default.createElement(
                          'div',
                          { className: 'details-wrapper' },
                          row.name
                        )
                      )
                    ),
                    icon && React__default.createElement(
                      'span',
                      {
                        className: 'taxonomy-icon',
                        style: {
                          position: 'absolute',
                          right: '20px',
                          top: '50%',
                          transform: 'translateY(-50%) translateX(50px)',
                          transition: 'all .25s',
                          pointerEvents: 'none'
                        } },
                      '\u2192'
                    )
                  )
                )
              )
            );
          }
        })
      )
    ),
    icon && React__default.createElement(
      'style',
      { jsx: 'true' },
      '\n          .taxonomy-card .taxonomy-icon {\n            transform: translateY(-50%) translateX(10px) !important;\n          }\n          .taxonomy-card.card:hover .taxonomy-icon {\n            transform: translateY(-50%) translateX(5px) scale(1.25) rotate(-180deg) !important;\n          }\n        '
    )
  );
};

module.exports = RolesDeck;
