import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose";

var _templateObject;

import React from 'react';
import styled from 'styled-components';
import { Button, FormError, TextArea } from '../../../Common';
import { Controller } from 'react-hook-form';
import { useVoucherForm, useCardsContext } from '../../checkoutVoucher.context';
import { useGlobalLabels } from '@sentecacommerce-theme/lib';
export var FormBottom = () => {
  var {
    formControl,
    errors,
    handleFormSubmit
  } = useVoucherForm();
  var {
    cardId,
    customAmount
  } = useCardsContext();
  var {
    buttons
  } = useGlobalLabels(); // const labels = useStrings('checkoutVoucher');

  var isActive = cardId.length !== 0 || Number(customAmount) > 0;
  return /*#__PURE__*/React.createElement(InputsWrapper, null, /*#__PURE__*/React.createElement("div", {
    className: "col-12"
  }, /*#__PURE__*/React.createElement(Controller, {
    control: formControl,
    name: "additionalInfo",
    as: /*#__PURE__*/React.createElement(TextArea, null)
  }), /*#__PURE__*/React.createElement(FormError, {
    errors: errors,
    fieldName: "additionalInfo"
  })), /*#__PURE__*/React.createElement("div", {
    className: "col-12"
  }, /*#__PURE__*/React.createElement(Button, {
    onClick: handleFormSubmit,
    variant: !isActive ? 'disabled' : 'primary',
    borderRadius: "normal",
    fullWidth: true
  }, buttons.addToBag)));
};
var InputsWrapper = styled.div.attrs({
  className: 'row g-4'
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n  & textarea {\n    margin-top: 0;\n  }\n"])));
//# sourceMappingURL=index.js.map