/**
 * External dependencies
 */
import { __ } from "@wordpress/i18n";
import {
  useBlockProps,
  RichText,
  InspectorControls,
} from "@wordpress/block-editor";
import { PanelBody } from "@wordpress/components";
import { getSetting } from "@woocommerce/settings";
/**
 * Internal dependencies
 */
import "./style.scss";
import "./block";
import Block from "./block";
const { optInDefaultText } = getSetting("epaka-pl_data", "");

export const Edit = ({ attributes, setAttributes }) => {
  const { text } = attributes;
  const blockProps = useBlockProps();
  return (
    <div {...blockProps}>
      <InspectorControls>
        <PanelBody title={__("Block options", "epaka-pl")}>
          Options for the block go here.
        </PanelBody>
      </InspectorControls>
      <div>epaka.pl map</div>
      {/*<CheckboxControl*/}
      {/*    id="newsletter-text"*/}
      {/*    checked={false}*/}
      {/*    disabled={true}*/}
      {/*/>*/}
      {/*<RichText*/}
      {/*    value={text || optInDefaultText}*/}
      {/*    onChange={(value) => setAttributes({ text: value })}*/}
      {/*/>*/}
    </div>
  );
};

export const Save = ({ attributes }) => {
  const { text } = attributes;
  return (
    <div {...useBlockProps.save()}>
      <RichText.Content value={text} />
    </div>
  );
};
