(self.webpackChunk=self.webpackChunk||[]).push([[305],{14305:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>l});const a=JSON.parse('[{"dataIndex":"title","key":"title","title":"Title","scopedSlots":{"customRender":"locale"}},{"key":"actions","width":120,"align":"right","scopedSlots":{"customRender":"actions"}}]'),o={props:["categories"],metaInfo:function(){return{title:this.trans("Categories")}},data:function(){return{visible:!1,locale:this.$page.props.locale||"tm",form:this.$inertia.form({title:{tm:void 0,ru:void 0,en:void 0}})}},computed:{columns:function(){var t=this;return a.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 l=(0,s(51900).Z)(o,(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:"locale",fn:function(e){return s("span",{},[t._v("\n      "+t._s(e[t.$page.props.locale||"tm"])+"\n    ")])}},{key:"actions",fn:function(e,a){return s("span",{},[s("a-tooltip",{attrs:{title:t.trans("Create")}},[s("a-button",{attrs:{type:"danger",ghost:"",icon:"delete"},on:{click:function(){return t.destroy("categories",a.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")||t.formStatus("title.tm")||t.formStatus("title.ru")||t.formStatus("title.en"),help:t.formHelp("title")||t.formHelp("title.tm")||t.formHelp("title.ru")||t.formHelp("title.en")}},[s("a-input-group",{staticClass:"flex",attrs:{compact:""}},[s("a-input",{attrs:{placeholder:t.trans("Title")},model:{value:t.form.title[t.locale],callback:function(e){t.$set(t.form.title,t.locale,e)},expression:"form.title[locale]"}}),t._v(" "),s("a-select",{staticClass:"w-44",model:{value:t.locale,callback:function(e){t.locale=e},expression:"locale"}},[s("a-select-option",{attrs:{value:"tm"}},[t._v("Türkmençe")]),t._v(" "),s("a-select-option",{attrs:{value:"ru"}},[t._v("Русский")]),t._v(" "),s("a-select-option",{attrs:{value:"en"}},[t._v("English")])],1)],1)],1)],1)],1)],1)}),[],!1,null,null,null).exports}}]);