import{L as V}from"./Layout-DhxLvS0V.js";import{T as w}from"./TextInput-UGcC5hIa.js";import{S as v}from"./SelectInput-BeV75IPk.js";import{T as h}from"./TextareaInput-BCCh4Nha.js";import{L as x}from"./LoadingButton-BqD68voa.js";import{F as C}from"./FileInput-BAEpJ7ii.js";import{X as T,B as k,C as s,j as m,t as a,m as i,k as l,H as L,E as u,y as n,F as S,q as B,z as E,x as F}from"./vendor-CoimUlS3.js";import{_ as I}from"./RichEditor-5gaZmhKN.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./LogoutButton-BZlSuKxY.js";import"./app-W9XHfen4.js";import"./utils-CXPYudwi.js";/* empty css                                                                 */import"./ui-CI37mw-K.js";import"./Logo-DiOikIGZ.js";import"./FlashMessages-D1juQjH6.js";const N={metaInfo:{title:"Create a new post"},components:{LoadingButton:x,SelectInput:v,TextareaInput:h,TextInput:w,FileInput:C,Link:k,Head:T,RichEditor:I},layout:V,props:{title:String,types:Array},remember:"form",data(){return{form:this.$inertia.form({title:null,type_id:null,image:null,details:""})}},methods:{store(){this.form.post(this.route("posts.store"))}}},U={class:"bg-white rounded-md shadow overflow-hidden max-w-full"},R={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},j={value:null},q=["value"],D={class:"pr-6 pb-8 w-full"},z={class:"form-label"},A={key:0,class:"text-red-600 text-sm mt-1"},M={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex justify-end items-center"};function P(r,o,p,X,e,d){const f=s("Head"),c=s("text-input"),_=s("select-input"),b=s("RichEditor"),g=s("file-input"),y=s("loading-button");return a(),m("div",null,[i(f,{title:r.$t(p.title)},null,8,["title"]),l("div",U,[l("form",{onSubmit:o[4]||(o[4]=L((...t)=>d.store&&d.store(...t),["prevent"]))},[l("div",R,[i(c,{modelValue:e.form.title,"onUpdate:modelValue":o[0]||(o[0]=t=>e.form.title=t),error:e.form.errors.title,class:"pr-6 pb-8 w-full lg:w-2/3",label:r.$t("Title")},null,8,["modelValue","error","label"]),i(_,{modelValue:e.form.type_id,"onUpdate:modelValue":o[1]||(o[1]=t=>e.form.type_id=t),error:e.form.errors.type_id,class:"pr-6 pb-8 w-full lg:w-1/3",label:r.$t("Type"),required:!0},{default:u(()=>[l("option",j,n(r.$t("Select type")),1),(a(!0),m(S,null,B(p.types,t=>(a(),m("option",{key:t.id,value:t.id},n(t.name),9,q))),128))]),_:1},8,["modelValue","error","label"]),l("div",D,[l("label",z,n(r.$t("Details"))+":",1),i(b,{modelValue:e.form.details,"onUpdate:modelValue":o[2]||(o[2]=t=>e.form.details=t),class:"mt-1"},null,8,["modelValue"]),e.form.errors.details?(a(),m("div",A,n(e.form.errors.details),1)):E("",!0)]),i(g,{modelValue:e.form.image,"onUpdate:modelValue":o[3]||(o[3]=t=>e.form.image=t),error:e.form.errors.image,class:"pb-8 pr-6 w-full lg:w-1/3",type:"file",accept:"image/*",label:r.$t("Feature image")},null,8,["modelValue","error","label"])]),l("div",M,[i(y,{loading:e.form.processing,class:"btn-indigo",type:"submit"},{default:u(()=>[F(n(r.$t("Create Post")),1)]),_:1},8,["loading"])])],32)])])}const ne=H(N,[["render",P]]);export{ne as default};
