import{d as b,C as k,E as j,a as i,o as d,e as a,b as r,u as e,h as w,y as C,k as m,w as l,i as n,t as u,F as y,B as V}from"./app-D_cNhTOt.js";import{_ as $,a as h,b as P,c as B,d as E}from"./AppLayout.vue_vue_type_script_setup_true_lang-kdLGGf-_.js";import{_ as p}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-BbjSNLws.js";import{_ as c}from"./Label.vue_vue_type_script_setup_true_lang-CsAMCf-a.js";import{_ as v}from"./Input.vue_vue_type_script_setup_true_lang-C7QVdt1n.js";import"./useForwardExpose-4P0NPntM.js";import"./VisuallyHidden-V0BOAZdg.js";import"./RovingFocusGroup-Ciyu9vLm.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./index-Z7dItZLR.js";import"./createLucideIcon-1FJ9MNCd.js";const F={class:"p-6"},N={class:"space-y-4"},S={class:"space-y-1"},q={key:0,class:"text-red-500 text-sm"},D={class:"space-y-1"},M={key:0,class:"text-red-500 text-sm"},T={class:"space-y-4"},U={class:"space-y-1"},A={key:0,class:"text-red-500 text-sm"},H={class:"col-span-2 flex justify-end mt-4 space-x-2"},te=b({layout:$,__name:"Project-create",setup(L){const s=k({name:"",description:"",sprint:null}),f=j(),_=[{value:1},{value:2},{value:3}],x=()=>{s.post("/project-management/project-create",{onSuccess:()=>{f.success("Project created successfully!"),s.reset()},onError:()=>{f.error("Failed to create project. Please check the form.")}})},g=()=>{s.reset()};return(R,t)=>(d(),i(y,null,[a(e(w),{title:"Create Project"}),r("div",F,[t[9]||(t[9]=r("div",{class:"flex justify-between items-center mb-6"},[r("h1",{class:"text-2xl font-bold"},"Add Project")],-1)),t[10]||(t[10]=r("p",{class:"mb-6"},"Please fill-up the form to create new project",-1)),r("form",{onSubmit:C(x,["prevent"]),class:"grid grid-cols-2 gap-6"},[r("div",N,[r("div",S,[a(e(c),null,{default:l(()=>[...t[3]||(t[3]=[n("Project",-1)])]),_:1}),a(e(v),{modelValue:e(s).name,"onUpdate:modelValue":t[0]||(t[0]=o=>e(s).name=o),type:"text",placeholder:"Enter project name",required:""},null,8,["modelValue"]),e(s).name?(d(),i("div",q,u(e(s).errors.name),1)):m("",!0)]),r("div",D,[a(e(c),null,{default:l(()=>[...t[4]||(t[4]=[n("How many sprints?",-1)])]),_:1}),a(e(E),null,{default:l(()=>[a(e(h),{asChild:""},{default:l(()=>[a(e(p),{class:"w-full bg-white dark:bg-neutral-900 dark:text-gray-100 text-gray-800 border rounded hover:bg-gray-50 flex justify-between items-center"},{default:l(()=>[r("span",null,u(e(s).sprint?_.find(o=>o.value===e(s).sprint)?.value:"Select number of sprints"),1),t[5]||(t[5]=r("svg",{class:"w-4 h-4 ml-2 text-neutral-500",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 9l-7 7-7-7"})],-1))]),_:1})]),_:1}),a(e(P),{side:"bottom",align:"start",class:"bg-white text-gray-800 dark:bg-neutral-900 dark:text-gray-100 border rounded shadow-lg"},{default:l(()=>[(d(),i(y,null,V(_,o=>a(e(B),{key:o.value,class:"text-gray-800 dark:text-gray-100 hover:bg-gray-50",onClick:z=>e(s).sprint=o.value},{default:l(()=>[n(u(o.value),1)]),_:2},1032,["onClick"])),64))]),_:1})]),_:1}),e(s).sprint?(d(),i("div",M,u(e(s).errors.sprint),1)):m("",!0)])]),r("div",T,[r("div",U,[a(e(c),null,{default:l(()=>[...t[6]||(t[6]=[n("Description",-1)])]),_:1}),a(e(v),{modelValue:e(s).description,"onUpdate:modelValue":t[1]||(t[1]=o=>e(s).description=o),type:"text",placeholder:"Enter project description",required:""},null,8,["modelValue"]),e(s).description?(d(),i("div",A,u(e(s).errors.description),1)):m("",!0)])]),r("div",H,[a(e(p),{type:"button",variant:"outline",onClick:t[2]||(t[2]=o=>g())},{default:l(()=>[...t[7]||(t[7]=[n(" Reset ",-1)])]),_:1}),a(e(p),{type:"submit",variant:"default",disabled:e(s).processing},{default:l(()=>[...t[8]||(t[8]=[n(" Create Project ",-1)])]),_:1},8,["disabled"])])],32)])],64))}});export{te as default};
