import{_ as h}from"./page-search.vue_vue_type_script_setup_true_lang.e284bf07.js";import{b as d,p as f,at as m,x as k,f as P,j as r}from"./index.4d3e3847.js";import{P as v}from"./page-content.1fdb6363.js";const R=d({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}=m("Auth",{permissions:f([])});function p(){const{contentConfig:e,events:t}=n,{content:a={}}=t;if(!!e)return r(v,{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 g(){const{searchConfig:e}=n;return e?r(h,{formConfig:e,onResetBtnClick:l,onSearchBtnClick:u},null):null}return k(()=>o,()=>{const e=P(o),{getContentRef:t}=n;e&&t&&t(e)},{deep:!0}),()=>r("div",{class:"w-full h-full"},[g(),p()])}}),w=R;export{w as P};
