import{P as p,_ as d}from"./page-content.e0c7af12.js";import{a as m,r as f,aI as k,w as P,u as v,f as r}from"./index.4d061c66.js";const R=m({name:"PageContainer",props:{pageName:{type:String,default:""},contentConfig:{type:Object},searchConfig:{type:Object},getContentRef:{type:Function},hooks:{type:Object,default:()=>({})},events:{type:Object,default:()=>({})}},setup(n,{slots:c}){const{pageSearchHook:s}=n.hooks,{handleResetClick:l,handleSearchClick:u,pageContentRef:i}=s?s():{},o=i||f(null),{permissions:C}=k("Auth",{permissions:f([])});function g(){const{contentConfig:e,events:t}=n,{content:a={}}=t;if(!!e)return r(p,{class:"h-full",ref:o,contentConfig:e,powers:C.value,onPreviewBtnClick:a.preview,onCreateBtnClick:a.create,onUpdateBtnClick:a.update},{header:()=>c.content_header&&c.content_header()})}function h(){const{searchConfig:e}=n;return e?r(d,{formConfig:e,onResetBtnClick:l,onSearchBtnClick:u},null):null}return P(()=>o,()=>{const e=v(o),{getContentRef:t}=n;e&&t&&t(e)},{deep:!0}),()=>r("div",{class:"w-full h-full"},[h(),g()])}}),j=R;export{j as P};
