import{j as c,aw as d,ax as S}from"./mui-vendor-CkIVaoQP.js";import{r as l}from"./react-vendor-CmFgShSM.js";import{a as g,u as v,f as y}from"./redux-vendor-B7uoacJt.js";import{L as C,j as x,h as i,A,G as _,ae as f,af as E}from"./index-Vwb3Bce5.js";const I=g("PROVINCE_UPDATE_SLAUGHTER_KILLPLACE_SERVICE",async(t,{dispatch:a})=>{try{a(C());const{data:r,status:s}=await x.put("kill_house_percent/0/",t);return a(i()),{data:r,status:s}}catch(r){return a(i()),{error:r.response.data.result}}}),N=({killHouseForKiller:t,slaughterKey:a,disabled:r})=>{const s=v(),[o]=l.useContext(A),[p,h]=l.useState(t==null?void 0:t.key),{slaughterGetKillerKillhouses:n}=y(e=>e.slaughterSlice),m=e=>{s(I({percentage_key:a,kill_house_key:e.target.value})).then(u=>{u.payload.error?o({vertical:"top",horizontal:"center",msg:u.payload.error,severity:"error"}):(s(f()),s(E()),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))}),h(e.target.value)};return c.jsx(_,{container:!0,alignItems:"center",justifyContent:"center",children:c.jsx(d,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:p,onChange:m,style:{width:"170px"},size:"small",disabled:r,children:n==null?void 0:n.map((e,u)=>c.jsx(S,{value:e.key,children:e.name},u))})})};export{N as P};
