import * as React from "react";
import { useEffect } from "react";
import { ConfigProvider } from "antd";
import { baseLayoutStore as store } from "@/layouts/BaseLayout/Store";
import styles from "../index.less";

export default ({ children }: any) => {
  useEffect(() => {
    ConfigProvider.config({
      theme: {
        primaryColor: store.primaryColor
      }
    });
  }, [store.primaryColor]);

  return (
    <div
      className={styles.root}
      style={{
        width: "100%",
        height: "100%",
        overflow: "hidden"
      }}
    >
      {children}
    </div>
  );
};
