import React, { useContext } from 'react';
import { SchemaForUI } from '@pdfme/common';
import { readFiles } from '../../../../helper';
import { I18nContext } from '../../../../contexts';
import { SidebarProps } from '..';
import closeIcon from '../../../../assets/icons/close.svg';

const shapes = {
  default:
    'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu4AAALuAQMAAADL0wGJAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAGUExURbzAw+rv8fKruy0AAAPoSURBVHja7dwxbtwwEEBRCkKwRQodYftcYk+ROkcJz5NTsEuZK/AIKlIQAUEnke0VqQ0pA5zxWvFnZcD2s0CNuENxPOZBc0QDDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD/+P8bkxvnTzzjTG0M2b5rh08rHNT518aPOnTt63+aGTd23edPJ2h//ax+/oO6Gzx6c78+cuPu7x01vmwx5/6uLnO/PjO+b/rGifvtWH3VnT9vmh/e3eqx/bc9d79af2YwEPDw8P/6r8r1GVt5VcUoZPtXxGhp9rGYEM72vbEBne1hJ5Gb6ayIvwqZppi/CxmgqL8KGaTIrwc3WDfATeV/ffIryr7r+PwNvq/vsIfH17D5/qbw/gb/mLKp/OqnycFPj14yqcJPm4vfp5VJ0cP6jyzqjy9rr2q/Dr4qzBp3V5E1wxp/V3rl8LXn32qF6fAY31Psv2NXi/5lQaH+Vuzak0eLsmPRppVPa3FPiU3QiFFDZmD4FCAh6yxV+Bn7O9isLmx2d/TGHr5rI7obDxtFkcKWyb89M2+U1/sX7Kv7Io8gaxFy5l2D/faRk++3x6PgsalV52+fwUW4j/+eGhDPuneyH/otHmp9jyfHHMLM6n4phZnI/FObA4H4qDWnF+Lo46xXlflG+I864o3xDnbVG+Ic6X9RXSfCrrK6T5WBZASPOhrFCQ5ufyjF+a92XdkjTvyrolad6WdUvS/KawSI7/sQn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mTeXyVuvVtD2irz/iZn3p9kAud+ZGz/zPsza6ncY29M5v1JJvBrmfc3kPRkjFmkHch/BR6VeX+VmMDdgfMz79PsyywOXCrY78uCfWZ3MPmfIZ0NDIgMYbV2OZqXGVaPDNFWK6JZQmUqcGBgDqufJtKVVzF5c/9lKvUcmk6YDVyDy8lafhuRVvlQjNs5aP4kl7kAXUfMIRUhu5b0elbu3+qsHroC65HeM/8LuoX35m17KkKo1hTqDbwi3L9ZlYwhff+dnnvHqpfkX6OB1oYxa6drEUxe0Ja6nIxvOplNJ9Uxn6jYubJMzR1U5HcvM6EhCJ7Amkf9HXVv0g0CszqaCKxPWl5XQl0o7h7gQfFnmJXVIISTF2LuEq9P+l24a8BnmZXFG6Qa09J35CPWa/mEVKJzv4DPMiuDqUBf4H31B0UtuDSS9KTLBkGfZ1ak44G7Iz4o8kGLbsCj5K8bbVYmNwJHRn1Y9JNSKwBPAH2CP9cswlDgIFJJ2hBFPOrYC3gc3eLfZkW4g/Tg0ozIDy1ivaH3gG2BZwr4bDOFG0lX3tDJW7TOpMr3yjdAvHlTbjOA0yhQ1F3oBZkFDCMVz96JNKHNquJtoD/pUcna64VuZXRv3nJu04Gf4weTFqgvMJziD5I3b823WcDtwIbYIu1LuiLPpPgD563e2xTgOlKRitIpe8WMnsChpNvzm1Hsd3arj8mkF3GGkt6mG19scxau7BN4fksD2wHbk2oZrUoqU9IDT2xrvanAWGAc8CnwL9Ijv8+TFqn3Qn1mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZhXwX3idCmWusHsMAAAAAElFTkSuQmCC',
};

const ExampleInputEditor = (
  props: Pick<SidebarProps, 'changeSchemas'> & { activeSchema: SchemaForUI }
) => {
  const { changeSchemas, activeSchema } = props;
  const i18n = useContext(I18nContext);

  return (
    <div className="PdfMe__ExampleInputEditor">
      <label>{i18n('inputExample')}</label>
      {activeSchema.type === 'image' ? (
        <div>
          {Object.entries(shapes).map(([key, shape]) => (
            <button
              onClick={() =>
                changeSchemas([{ key: 'data', value: shape, schemaId: activeSchema.id }])
              }
              key={key}
            >
              <img style={{ maxHeight: 30 }} src={shape} alt={key} />
            </button>
          ))}
          <div style={{ position: 'relative' }}>
            {activeSchema.data ? (
              <div style={{ margin: '0 auto' }}>
                <button
                  style={{
                    position: 'absolute',
                    top: 0,
                    left: 0,
                    display: 'flex',
                    justifyContent: 'center',
                    alignItems: 'center',
                    color: '#333',
                    background: '#f2f2f2',
                    cursor: 'pointer',
                    borderRadius: 2,
                    border: '1px solid #767676',
                    height: 20,
                    width: 20,
                  }}
                  aria-label="close"
                  onClick={() =>
                    changeSchemas([{ key: 'data', value: '', schemaId: activeSchema.id }])
                  }
                >
                  <img src={closeIcon} alt="Close icon" width={10} />
                </button>
                <img style={{ maxHeight: 180 }} src={activeSchema.data} alt="Input Example" />
              </div>
            ) : (
              <label>
                <input
                  style={{ color: '#333', background: 'none' }}
                  onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
                    const { files } = e.target;
                    readFiles(files, 'dataURL').then((result) => {
                      changeSchemas([
                        { key: 'data', value: result as string, schemaId: activeSchema.id },
                      ]);
                    });
                  }}
                  type="file"
                  accept="image/jpeg, image/png"
                />
              </label>
            )}
          </div>
        </div>
      ) : (
        <textarea
          rows={6}
          onChange={(e) =>
            changeSchemas([{ key: 'data', value: e.target.value, schemaId: activeSchema.id }])
          }
          style={{
            width: '100%',
            border: '1px solid #767676',
            borderRadius: 2,
            color: '#333',
            background: activeSchema.data ? 'none' : '#ffa19b',
          }}
          value={activeSchema.data}
        />
      )}
    </div>
  );
};

export default ExampleInputEditor;
