import{useState as m}from"react";import n from"axios";function u(){const[o,e]=m(""),[r,a]=m(!1);return{itemName:o,isLoading:r,fetchItemName:async t=>{if(!t||t.trim()===""){e("");return}a(!0);try{const s=await n.get(route("admin.vouchers.items"),{params:{item_id:t}});e(s.data.name||"")}catch{e("Item not found")}finally{a(!1)}},setItemName:e}}export{u};
