function _extends() {
  _extends =
    Object.assign ||
    function (target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
  return _extends.apply(this, arguments);
}

import React from 'react';
import styled from 'styled-components';
import ReactTooltip from 'react-tooltip';
export const IconButton = ({ onclick, svg, className, as }) => {
  return /*#__PURE__*/ React.createElement(
    PrimaryBtn,
    {
      as: as,
      onClick: onclick,
      className: `btn ${className}`,
    },
    /*#__PURE__*/ React.createElement(
      'svg',
      null,
      /*#__PURE__*/ React.createElement('use', {
        href: `/images/icons.svg#${svg}`,
      })
    )
  );
};
export const RoundIconButton = ({ onclick, svg }) => {
  return /*#__PURE__*/ React.createElement(
    RoundBtn,
    {
      onClick: onclick,
      className: 'btn',
    },
    /*#__PURE__*/ React.createElement(
      'svg',
      null,
      /*#__PURE__*/ React.createElement('use', {
        href: `/images/icons.svg#${svg}`,
      })
    )
  );
};
export const MoreDropButton = ({ onclick, svg, title, color }) => {
  return /*#__PURE__*/ React.createElement(
    DropBtn,
    {
      onClick: onclick,
      className: 'btn',
      color: color,
    },
    /*#__PURE__*/ React.createElement('span', null, title),
    /*#__PURE__*/ React.createElement(
      'svg',
      null,
      /*#__PURE__*/ React.createElement('use', {
        href: `/images/icons.svg#${svg}`,
      })
    )
  );
};
export const IconTxtButton = ({ onclick, svg, title, extraName }) => {
  return /*#__PURE__*/ React.createElement(
    PrimaryText,
    {
      onClick: onclick,
      className: `btn ${extraName || ''}`,
    },
    /*#__PURE__*/ React.createElement(
      'svg',
      null,
      /*#__PURE__*/ React.createElement('use', {
        href: `/images/icons.svg#${svg}`,
      })
    ),
    /*#__PURE__*/ React.createElement('span', null, title)
  );
};
export const TabButton = ({ svg, title, className }) => {
  return /*#__PURE__*/ React.createElement(
    TabBtn,
    {
      className: `btn ${className}`,
    },
    svg
      ? /*#__PURE__*/ React.createElement(
          'svg',
          null,
          /*#__PURE__*/ React.createElement('use', {
            href: `/images/icons.svg#${svg}`,
          })
        )
      : '',
    /*#__PURE__*/ React.createElement('span', null, title)
  );
};
export const FormPageButton = ({
  onclickPage,
  onclickDelete,
  svg,
  title,
  className,
}) => {
  return /*#__PURE__*/ React.createElement(
    DivTabBtn,
    {
      className: `btn ${className}`,
    },
    /*#__PURE__*/ React.createElement(
      'span',
      null,
      /*#__PURE__*/ React.createElement(ReactTooltip, {
        id: 'delete',
      })
    ),
    /*#__PURE__*/ React.createElement(
      'span',
      {
        onClick: () => onclickPage(),
        style: {
          marginRight: '5px',
          padding: '2px',
        },
      },
      title
    ),
    svg
      ? /*#__PURE__*/ React.createElement(
          'svg',
          {
            'data-for': 'delete',
            'data-tip': 'Delete page',
            style: {
              marginLeft: '5px',
              cursor: 'pointer',
            },
            onClick: () => onclickDelete(),
          },
          /*#__PURE__*/ React.createElement('use', {
            href: `/images/icons.svg#${svg}`,
          })
        )
      : ''
  );
};
export const FormFieldButton = ({ onclick, svg, title, description }) => {
  return /*#__PURE__*/ React.createElement(
    FormFieldBtn,
    {
      onClick: onclick,
    },
    /*#__PURE__*/ React.createElement(
      'svg',
      null,
      /*#__PURE__*/ React.createElement('use', {
        href: `/images/icons.svg#${svg}`,
      })
    ),
    /*#__PURE__*/ React.createElement(
      'div',
      {
        className: 'btn-details',
      },
      /*#__PURE__*/ React.createElement('h3', null, title),
      /*#__PURE__*/ React.createElement('p', null, description)
    )
  );
};
export const PrimaryIconButton = ({
  onclick,
  svg,
  title,
  color,
  opt,
  href,
  className,
  ...props
}) => {
  return /*#__PURE__*/ React.createElement(
    PrimaryIconBtn,
    _extends(
      {
        as: opt,
        href: href,
        onClick: onclick,
        className: `btn ${className}`,
        color: color,
      },
      props
    ),
    /*#__PURE__*/ React.createElement(
      'svg',
      null,
      /*#__PURE__*/ React.createElement('use', {
        href: `/images/icons.svg#${svg}`,
      })
    ),
    /*#__PURE__*/ React.createElement('span', null, title)
  );
};
const PrimaryBtn = styled.button`
  background-color: transparent;
  padding: 0.8rem;
  color: #61677c;
  svg {
    width: 15px;
    height: 15px;
  }
`;
const RoundBtn = styled.button`
  min-width: 35px;
  max-height: 35px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: ${props => (props.bg ? props.bg : 'rgba(0, 75, 255, 0.2)')};
  padding: 0.8rem;
  color: var(--co-primary);
  svg {
    width: 17px;
    height: 17px;
  }
`;
const PrimaryText = styled.button`
  background: transparent;
  padding: 0.8rem;
  color: var(--co-primary);
  svg {
    width: 24px;
    height: 14px;
  }
  span {
    font-family: var(--ff-sbold);
  }
  &.bigger-icon {
    svg {
      width: 24px;
      height: 24px;
      margin-right: 0.5rem;
    }
  }
`;
const PrimaryIconBtn = styled.button`
  background: transparent;
  padding: 0.8rem;
  color: ${props => (props.color ? props.color : '#838CA2')};
  svg {
    width: 17px;
    height: 17px;
  }
  span {
    margin-left: 0.5rem;
    font-family: var(--ff-medium);
    font-weight: 500;
    font-size: 1.4rem;
  }
  &.responsive {
    span {
      display: none;
      @media (min-width: 768px) {
        display: inline-block;
      }
    }
  }
`;
const DropBtn = styled.button`
  background: transparent;
  padding: 0.8rem;
  color: ${props => (props.color ? props.color : '#004BFF')};
  font-size: 1.4rem;
  align-items: center;
  text-transform: none;
  svg {
    width: 12px;
    height: 12px;
  }
  span {
    font-family: var(--ff-sbold);
    margin-right: 0.5rem;
  }
`;
const DivTabBtn = styled.div`
  background: rgb(241, 241, 244);
  padding: 0.6rem 1.5rem;
  color: #61677c;
  font-size: 1.4rem;
  align-items: center;
  justify-content: center;
  text-transform: capitalize;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  min-width: 93px;
  font-family: var(--ff-medium);
  font-weight: 500;
  svg {
    width: 15px;
    height: 15px;
    margin-right: 0.5rem;
  }
  &.active {
    background: rgba(0, 75, 255, 0.1);
    color: #0a1045;
    border-bottom: 2px solid #004bff;
    font-family: var(--ff-sbold);
    font-weight: 600;
  }
`;
const TabBtn = styled.button`
  background: #f1f1f4;
  padding: 1rem 2.2rem;
  color: #61677c;
  font-size: 1.4rem;
  align-items: center;
  justify-content: center;
  text-transform: capitalize;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  min-width: 93px;
  font-weight: 500;
  svg {
    width: 15px;
    height: 15px;
    margin-right: 0.5rem;
  }
  span {
    font-family: var(--ff-medium);
  }
  &.active {
    background: rgba(0, 75, 255, 0.1);
    color: #0a1045;
    border-bottom: 2px solid #004bff;
  }
`;
const FormFieldBtn = styled.button`
  display: flex;
  align-items: center;
  padding: 1.5rem 1rem;
  width: 100%;
  &:hover {
    background-color: #fbfbff;
  }

  svg {
    min-width: 32px;
    width: 32px;
    height: 32px;
  }
  .btn-details {
    margin-left: 1rem;
    text-align: left;
    h3 {
      font-family: var(--ff-medium);
      font-weight: 500;
      font-size: 1.4rem;
      line-height: 1.6;
      color: #0a1045;
    }
    p {
      font-family: var(--ff-body);
      font-weight: 400;
      font-size: 1.4rem;
      line-height: 1.6;
      color: #838ca2;
    }
  }
`;
