import{d as x,s as r,h as b,o as V,g as s,u as o,i as g,w as d,j as e,l as m,k as $,F as w,W as k}from"./app-Cb9hmj6k.js";import{_ as y,a as h}from"./AppLayout.vue_vue_type_script_setup_true_lang-CteAxl0C.js";import{_ as C}from"./Input.vue_vue_type_script_setup_true_lang-t_rUv_4v.js";import{_ as u}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-DKWl2XLX.js";import{_ as B}from"./Textarea.vue_vue_type_script_setup_true_lang-BbvsSknx.js";import{t as f}from"./index-bRFR14ax.js";import"./index-hboZUdbT.js";import"./RovingFocusGroup-CP1IPgEn.js";const E={class:"p-4 max-w-3xl mx-auto"},F={class:"space-y-4 bg-white p-6 rounded-xl border shadow-sm"},N={class:"space-y-2"},j={class:"space-y-2"},S={class:"flex justify-between gap-3 pt-4"},H=x({__name:"Edit",props:{doc:{}},setup(c){const i=c,a=r({title:i.doc.title,content:i.doc.content}),l=r(!1),p=[{title:"Панель управления",href:"/dashboard"},{title:"Документация",href:"/documentation"},{title:"Редактирование",href:""}];function _(){l.value=!0,k.put(`/documentation/${i.doc.id}`,a.value,{onSuccess:()=>{f.success("Документ обновлён")},onError:()=>{f.error("Ошибка обновления")},onFinish:()=>{l.value=!1}})}return(v,t)=>(V(),b(w,null,[s(o(g),{title:"Редактирование документа"}),s(h,{breadcrumbs:p},{default:d(()=>[s(o(y)),e("div",E,[t[6]||(t[6]=e("div",{class:"mb-6"},[e("h1",{class:"text-2xl sm:text-3xl font-bold"}," Редактирование документа "),e("p",{class:"text-sm text-muted-foreground"}," Обновите информацию в базе знаний ")],-1)),e("div",F,[e("div",N,[t[3]||(t[3]=e("label",{class:"text-sm font-medium"},"Заголовок",-1)),s(o(C),{modelValue:a.value.title,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value.title=n),placeholder:"Введите заголовок"},null,8,["modelValue"])]),e("div",j,[t[4]||(t[4]=e("label",{class:"text-sm font-medium"},"Содержимое",-1)),s(o(B),{modelValue:a.value.content,"onUpdate:modelValue":t[1]||(t[1]=n=>a.value.content=n),rows:"10",placeholder:"Описание, инструкции, ссылки..."},null,8,["modelValue"])]),e("div",S,[s(o(u),{variant:"outline",onClick:t[2]||(t[2]=n=>v.$inertia.visit("/documentation"))},{default:d(()=>t[5]||(t[5]=[m(" Назад ")])),_:1,__:[5]}),s(o(u),{disabled:l.value,onClick:_},{default:d(()=>[m($(l.value?"Сохранение...":"Сохранить"),1)]),_:1},8,["disabled"])])])])]),_:1})],64))}});export{H as default};
