import{Space as e,Button as t}from"antd";import{useState as o,useEffect as i}from"react";import{throttle as r}from"throttle-debounce";import n from"../HeaderBack/index.js";import{jsxs as d,jsx as a}from"react/jsx-runtime";function s(s){const{headerTitle:c,history:l,isShowHeader:p=!0,headerPrevious:u=!0,isShowFooter:h=!0,isShowAllAction:m=!0,backButtonText:g="关闭",contentPadding:y="20px",customActionButtons:f,extraActionButtons:x,children:w}=s,[v,b]=o(window.innerWidth),k=r(50,()=>{const e=document.querySelector("#page-layout");e&&b(e.offsetWidth)});return i(()=>{const e=setTimeout(()=>{k()},0);return m&&h&&window.addEventListener("resize",k),()=>{m&&h&&window.removeEventListener("resize",k),clearTimeout(e)}},[m,h]),d("div",{className:"page-layout",id:"page-layout",children:[m&&p&&a(n,{title:c,history:l,previous:u}),d("div",{style:{padding:y},children:[w&&"function"==typeof w?w():w,m&&h&&d("div",{className:"page-layout-footer",style:{position:"relative",zIndex:"9"},children:[a("div",{style:{height:"52px"}}),a("div",{style:{textAlign:"center",backgroundColor:"rgb(241, 241, 242)",padding:"10px 0",position:"fixed",bottom:"0",width:v,margin:"0px -20px"},children:f||d(e,{children:[x,a(t,{onClick:()=>l?.goBack?.()||window.history.back(),children:g})]})})]})]})]})}s.displayName="Page";export{s as default};
