import{_ as x}from"./Ba76BwjT.js";import{e as h,x as g,v as k,J as N,K as w,j as C,c as r,f as n,a as s,b as m,t as B,w as I,H as V,h as R,L as b,i as p,G as A,E,o as c,d as L,_ as $}from"./DpdQcRr7.js";import{u as j}from"./DuJ0NDcC.js";import"./BcpEzrWT.js";import"./D1zzHZdQ.js";const q={key:0,class:"company-loading has-text-centered py-6"},D={class:"icon is-large"},G={key:1,class:"company-error"},H={class:"notification is-warning"},J=h({__name:"[id]",setup(K){const _=g();k();const{$api:M}=N(),u=A(()=>_.params.id),l=p(!0),e=p(null),a=p(null),i=async()=>{l.value=!0,a.value=null;try{const o=await j(`/api/admin/companies/${u.value}`);o!=null&&o.company?e.value=o.company:(a.value="企業が見つかりませんでした",e.value=null)}catch(o){console.error("企業の取得に失敗しました:",o),a.value="企業の取得に失敗しました",e.value=null}finally{l.value=!1}},d=()=>{i()};return w(u,()=>{i()}),C(async()=>{await i()}),(o,t)=>{const y=E("Icon"),f=x,v=b;return c(),r("div",null,[n(l)?(c(),r("div",q,[s("span",D,[m(y,{icon:"mdi:loading",class:"mdi-spin"})]),t[0]||(t[0]=s("p",null,"読み込み中...",-1))])):n(a)?(c(),r("div",G,[s("div",H,[s("p",null,B(n(a)),1),m(f,{to:"/admin/companies",class:"button is-small mt-3"},{default:I(()=>[...t[1]||(t[1]=[L(" 一覧に戻る ",-1)])]),_:1})])])):n(e)?(c(),V(v,{key:2,company:n(e),"refetch-company":d},null,8,["company"])):R("",!0)])}}}),O=$(J,[["__scopeId","data-v-5766248f"]]);export{O as default};
