import { Layout } from "antd";
import AppRoutes from "../AppRoutes";
import { useSelector } from "react-redux";
import { isSideMenuCollapsed } from "../SideMenu/sideMenuSlice";
import { BreakpointLgWidth } from "../../utils/utils";

export default function PageContent() {
  const isCollpased = useSelector(isSideMenuCollapsed);

  return (
    <Layout
      style={{
        marginLeft:
          isCollpased || window.document.body.clientWidth < BreakpointLgWidth
            ? 0
            : 200,
      }}
    >
      <AppRoutes />
    </Layout>
  );
}
