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,rt as s}from"./vendor-mui-Ckcy4Lfd.js";import"./vendor-md-editor-DC6xr_29.js";import{p as c,v as l}from"./ui-BLXHSX1T.js";import{V as u}from"./index-JB73_g7R.js";import{_ as d,a as f}from"./skill-ZS39xCGU.js";import{t as p}from"./attachments-BKCJWgDD.js";import{t as m}from"./SkillForm-BXiqw4Of.js";var h=e(n(),1),g=t();function _(){let{projectId:e}=i(),t=r(),n=u(`skills`),[_,v]=(0,h.useState)([]);return(0,g.jsxs)(a,{children:[(0,g.jsx)(c,{breadcrumbs:[{label:`Skills`,to:`/${e}/skills`},{label:`Create`}],actions:(0,g.jsx)(o,{variant:`contained`,form:`skill-form`,type:`submit`,disabled:!n,children:`Create`})}),!n&&(0,g.jsx)(s,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot create skills.`}),(0,g.jsx)(m,{onSubmit:async n=>{if(!e)return;let r=await f(e,n);for(let t of _)await d(e,r.id,t).catch(()=>{});t(`/${e}/skills/${r.id}`)},onCancel:()=>t(`/${e}/skills`),submitLabel:`Create`}),(0,g.jsx)(l,{title:`Attachments`,sx:{mt:3},children:(0,g.jsx)(p,{files:_,onAdd:e=>v(t=>[...t,...e]),onRemove:e=>v(t=>t.filter((t,n)=>n!==e))})})]})}export{_ as default};