(self.webpackChunk=self.webpackChunk||[]).push([[339],{43339:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>o});var i=s(5335);const n={props:["categories"],metaInfo:function(){return{title:this.trans("Categories")}},data:function(){return{visible:!1,form:this.$inertia.form({title:void 0})}},computed:{columns:function(){var t=this;return i.map((function(e){return e.title=t.trans(e.title),e}))}},methods:{submit:function(){var t=this;this.form.post(this.route("categories.store"),{onSuccess:function(){t.visible=!1,t.$message.success(t.trans("Success message"))}})}}};const o=(0,s(51900).Z)(n,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"flex bg-white p-4 text-lg border-b border-gray-300 h-20 items-center"},[s("div",{staticClass:"flex-1 font-semibold"},[t._v(t._s(t.trans("Categories")))]),t._v(" "),s("div",[s("a-button",{attrs:{type:"primary"},on:{click:function(e){t.visible=!0}}},[t._v(t._s(t.trans("Create")))])],1)]),t._v(" "),s("a-table",{attrs:{dataSource:t.categories,columns:t.columns,pagination:!1,rowKey:"id"},scopedSlots:t._u([{key:"actions",fn:function(e,i){return s("span",{staticClass:"text-center"},[s("a-tooltip",{attrs:{title:t.trans("Create")}},[s("a-button",{attrs:{type:"danger",ghost:"",icon:"delete"},on:{click:function(){return t.destroy("categories",i.id)}}})],1)],1)}}])}),t._v(" "),s("a-modal",{attrs:{title:t.trans("Create"),"confirm-loading":t.form.processing,"ok-text":t.trans("OK"),"cancel-text":t.trans("Close"),destroyOnClose:""},on:{ok:t.submit},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[s("a-form",{nativeOn:{keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.submit(e)}}},[s("a-form-item",{attrs:{label:t.trans("Title"),validateStatus:t.formStatus("title"),help:t.formHelp("title")}},[s("a-input",{attrs:{placeholder:t.trans("Title"),"auto-focus":""},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1)],1)],1)],1)}),[],!1,null,null,null).exports},5335:t=>{"use strict";t.exports=JSON.parse('[{"dataIndex":"title","key":"title","title":"Title"},{"key":"count","title":"Count","scopedSlots":{"customRender":"count"},"width":140},{"dataIndex":"is_default","key":"is_default","scopedSlots":{"customRender":"is_default"},"width":140},{"key":"actions","width":180,"align":"right","scopedSlots":{"customRender":"actions"}}]')}}]);