import style from "./topSection.module.css";

import NextImage from "../../other/NextImage";
import HtmlParser from "react-html-parser";
import { useRouter } from "next/router";

const TopSliderSection = ({ siteText }) => {
  const router = useRouter();
  return (
    <>
      {siteText && (
        <>
          {/* <div className={`${style.slider_section} container`}>
            <div className={style.float}>
              <NextImage
                src={`${siteText.content[0].split("float[")[1].split("]")[0]}`}
                alt="float image"
              />
            </div>
            {siteText.content[0] && siteText.content[0].includes("title") && (
              <div className={style.text_section}>
                {siteText.content[0].includes("subtitle") && (
                  <div className={style.subtitle}>
                    {HtmlParser(
                      siteText.content[0].split("subtitle[")[1].split("]")[0]
                    )}
                  </div>
                )}
                <div className={style.text}>
                  {HtmlParser(
                    siteText.content[0].split("title[")[1].split("]")[0]
                  )}
                </div>
                <div
                  className={`primary_btn_no_animation ${style.btn}`}
                  onClick={() =>
                    siteText.content[0].includes("button_path[") &&
                    siteText.content[0]
                      .split("button_path[")[1]
                      .split("]")[0] &&
                    router.push(
                      siteText.content[0].split("button_path[")[1].split("]")[0]
                    )
                  }
                >
                  Order Now
                </div>
              </div>
            )}
            <div className={style.image_set}>
              <NextImage
                src={`${siteText.content[0].split("image[")[1].split("]")[0]}`}
                alt="float image"
              />
            </div>
          </div> */}
          {siteText.content[0].includes("qoute") && (
            <div className={`${style.qoute_section} container ql-editor`}>
              <hr />

              {HtmlParser(siteText.content[0].split("qoute[")[1].split("]")[0])}

              <hr />
            </div>
          )}
        </>
      )}
    </>
  );
};

export default TopSliderSection;
