import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i}from"./vendor-react-Cts2Wj-s.js";import{Q as a,X as o,at as s,rt as c}from"./vendor-mui-Ckcy4Lfd.js";import"./vendor-md-editor-DC6xr_29.js";import{p as l}from"./ui-BLXHSX1T.js";import{V as u}from"./index-JB73_g7R.js";import{g as d,u as f}from"./skill-ZS39xCGU.js";import{t as p}from"./SkillForm-BXiqw4Of.js";var m=e(n(),1),h=t();function g(){let{projectId:e,skillId:t}=i(),n=r(),g=u(`skills`),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!0),[x,S]=(0,m.useState)(null);return(0,m.useEffect)(()=>{!e||!t||f(e,t).then(v).catch(e=>S(e instanceof Error?e.message:String(e))).finally(()=>b(!1))},[e,t]),y?(0,h.jsx)(a,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,h.jsx)(s,{})}):x||!_?(0,h.jsx)(c,{severity:`error`,children:x||`Skill not found`}):(0,h.jsxs)(a,{children:[(0,h.jsx)(l,{breadcrumbs:[{label:`Skills`,to:`/${e}/skills`},{label:_.title,to:`/${e}/skills/${t}`},{label:`Edit`}],actions:(0,h.jsx)(o,{variant:`contained`,form:`skill-form`,type:`submit`,disabled:!g,children:`Save`})}),!g&&(0,h.jsx)(c,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot edit skills.`}),(0,h.jsx)(p,{skill:_,onSubmit:async r=>{!e||!t||(await d(e,t,r),n(`/${e}/skills/${t}`))},onCancel:()=>n(`/${e}/skills/${t}`)})]})}export{g as default};