import * as React from "react";
import EditorObject from "@sc/modules/page/Builder/EditorObject";
import PropertiesBuilder from "@sc/modules/v2/Properties/components/generator";
import _ from "lodash";

import { Testing } from "./live";
import { PluginProps } from "./types";

import testingPluginSettings from "./settings";

const PropertiesGenerator = (props) => {
  const { properties } = testingPluginSettings;
  return (
    <PropertiesBuilder
      {...props}
      title="Testing Properties"
      data={properties}
    />
  );
};

export const TestingComponent: React.FC<PluginProps> = (props) => {
  const { settings, mode, id } = props;

  return (
    <>
      <EditorObject
        {...props}
        title="Testing"
        PropertiesView={PropertiesGenerator}
      >
        <Testing {...settings} />
      </EditorObject>
    </>
  );
};
