import React from 'react';
import { Input, Row, Col } from 'antd';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const StringFormFieldValue = props => {
  const {
    value,
    preview
  } = props;
  const renderInput = () => {
    const {
      value,
      inputProps,
      onChange = () => {}
    } = props;
    return /*#__PURE__*/_jsx(Input, {
      ...inputProps,
      size: "small",
      value: value,
      onChange: event => {
        onChange(event.target.value, event);
      }
    });
  };
  const input = renderInput();

  // TODO DELETE
  if (!preview) {
    return input;
  }
  return /*#__PURE__*/_jsxs(Row, {
    gutter: 16,
    children: [/*#__PURE__*/_jsx(Col, {
      span: 12,
      children: input
    }), /*#__PURE__*/_jsx(Col, {
      span: 12,
      children: /*#__PURE__*/_jsx("a", {
        href: value,
        target: "_blank",
        rel: "noreferrer",
        children: value ? /*#__PURE__*/_jsx("img", {
          width: "200px",
          src: value,
          alt: "img",
          style: {
            border: '1px solid'
          }
        }) : null
      })
    })]
  });
};
export default StringFormFieldValue;
//# sourceMappingURL=StringFormFieldValue.js.map