import { func } from "prop-types";
import React, { useRef, useEffect, useState } from "react";
import imgUrl from "../../../images/avatar.png";
import tooltipConstants from "../Tooltip.constantProps";
import style from "./Tooltip.model.decorator.css";
import Tooltip from "../Tooltip";

function Default() {
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", Tooltip.getTitleProps("Submit <b>test</b>", true), "ok"));
}

function Scroll() {
  return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: "0 20px 50px 20px"
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      height: "100px",
      width: "300px",
      overflow: "scroll",
      position: "relative"
    }
  }, /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("button", {
    "data-title": "My button title"
  }, "My button"), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("button", Tooltip.getTitleProps("My <b>button</b> title", true), "My button")));
}

function ScrollOutSide(tooltip) {
  return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: "0 20px 50px 20px"
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      width: "300px",
      overflow: "scroll",
      position: "relative"
    }
  }, /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("button", {
    "data-title": "My button title"
  }, "My button"), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("button", Tooltip.getTitleProps("My <b>button</b> title", true), "My button")), tooltip);
}

function DefaultContainer(tooltip) {
  let containerRef = useRef(null);
  let [containerEle, setContainerElement] = useState();
  useEffect(() => {
    setContainerElement(containerRef.current);
  }, [containerRef.current]);
  return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: "0 20px 50px 20px"
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      width: "300px",
      overflow: "scroll",
      position: "relative"
    },
    ref: containerRef
  }, /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("button", {
    "data-title": "My button title"
  }, "My button"), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("div", null, "What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&APOS;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("button", Tooltip.getTitleProps("My <b>button</b> title", true), "My button")), /*#__PURE__*/React.createElement("button", {
    "data-title": "Outside container title"
  }, "Outside container button"));
}

export default (themeName => ({
  header: {
    title: "Tooltip Component",
    imgUrl: imgUrl,
    description: "Use the Tooltip component to display title in the popup. It will help user"
  },
  tabsList: ["Default", "Container"],
  tabsDetail: {
    Default: {
      displayName: "Default",
      description: "Default tooltip",
      componentsList: ["Default", "Scroll", "Scroll Outside"],
      componentsDetail: {
        ["Default"]: {
          arrow: false,
          $decorator: Default
        },
        ["Scroll"]: {
          arrow: true,
          $decorator: Scroll
        },
        ["Scroll Outside"]: {
          arrow: true,
          $decorator: ScrollOutSide
        }
      }
    },
    Container: {
      displayName: "Container",
      description: "Container tooltip",
      componentsList: ["Default"],
      componentsDetail: {
        ["Default"]: {
          arrow: false,
          $decorator: DefaultContainer
        }
      }
    }
  }
}));