ruạṛ
import{u as p,A as j,c as s,H as C,s as A,b0 as S,T as O,bN as V,f as z,aa as G,aW as U,a1 as W,bp as K,U as Q,h as l,a as X,dr as J,dp as Y,d as Z,dq as ee,eq as se,ds as te,z as ae,a5 as ie,W as T,S as ne,j as a,bt as oe,a_ as re,m as ce,bk as m,X as le,k as de,er as ue,a8 as me,a9 as pe,i as he,es as ve,r as be,e as ke}from"./bundle.9abe88c8.js";import{I as d}from"./InfoCard-3b3f3798.js";import{a as ge}from"./hooks-344a2ac4.js";import{D as _e}from"./DataTableColumnsPicker-72027136.js";import{u as fe}from"./useShowEditOption-6f2fb612.js";import{C as ye}from"./ClientActionButtons-a4f20d96.js";import{P as Ne}from"./PreviousNextNavigation-f6f14b66.js";import"./atoms-d3dbf501.js";function Te(o){const[t]=p(),{project:n}=o,r=j();return s(C,{children:!!(n&&n.private_notes)&&s("div",{className:"col-span-12 md:col-span-6 lg:col-span-3",children:s(d,{title:t("private_notes"),value:s("div",{className:"whitespace-normal max-h-56 overflow-y-auto",children:s("article",{className:A("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:S(n.private_notes)}})}),className:"h-full"})})})}function je(o){const[t]=p(),{project:n}=o,r=j();return s(C,{children:!!(n&&n.public_notes)&&s("div",{className:"col-span-12 md:col-span-6 lg:col-span-3",children:s(d,{title:t("public_notes"),value:s("div",{className:"whitespace-normal max-h-56 overflow-y-auto",children:s("article",{className:A("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:S(n.public_notes)}})}),className:"h-full"})})})}he.extend(ve);function Ee(){var k,g,_,f,y,N;const{documentTitle:o}=O("project"),{t}=p(),{id:n}=V(),{dateFormat:r}=z(),x=G(),h=U(),v=W(),w=K(),P=Q(),b=[{name:t("projects"),href:"/projects"},{name:t("project"),href:l("/projects/:id",{id:n})}],{data:e}=X({queryKey:["/api/v1/projects",`/api/v1/projects/${n}`],queryFn:()=>be("GET",ke(`/api/v1/projects/${n}?include=client,tasks,invoices,quotes,expenses`)).then(i=>i.data.data),staleTime:1/0}),$=ge(),F=J(),E=Y(),q=Z(),B=ee(),M=se(),R=te(),D=fe(),u=ae(),{changeTemplateVisible:H,setChangeTemplateVisible:I,changeTemplateResources:L}=ie();return e?a(T,{title:o,breadcrumbs:b,...(v("edit_project")||w(e))&&e&&{navigationTopRight:s(oe,{resource:e,actions:$,saveButtonLabel:t("edit"),onSaveClick:()=>x(l("/projects/:id/edit",{id:n})),cypressRef:"projectActionDropdown"})},afterBreadcrumbs:s(Ne,{entity:"project"}),children:[a("div",{className:"grid grid-cols-12 lg:space-y-0 gap-4",children:[s("div",{className:"col-span-12 md:col-span-6 lg:col-span-3",children:a(d,{title:e.name,children:[e&&a("div",{className:"flex space-x-20 my-3",children:[s("span",{className:"text-sm",style:{backgroundColor:u.$2,color:u.$3,colorScheme:u.$0},children:t("status")}),s(re,{entity:e})]}),e.client&&s(ye,{displayClientName:!0,client:e.client}),a("div",{className:"mt-2",children:[e.due_date.length>0&&a("p",{children:[t("due_date"),": ",ce(e.due_date,r)]}),a("p",{children:[t("budgeted_hours"),": ",h(e.budgeted_hours)]}),a("p",{children:[t("task_rate"),":"," ",q(e.task_rate,(k=e.client)==null?void 0:k.country_id,(g=e.client)==null?void 0:g.settings.currency_id)]})]}),a("div",{className:"mt-2",children:[(_=e==null?void 0:e.invoices)==null?void 0:_.map((i,c)=>s("div",{children:a(m,{to:l("/invoices/:id/edit",{id:i.id}),children:[t("invoice")," #",i.number]})},c)),(f=e==null?void 0:e.quotes)==null?void 0:f.map((i,c)=>s("div",{children:a(m,{to:l("/quotes/:id/edit",{id:i.id}),children:[t("quote")," #",i.number]})},c)),(y=e==null?void 0:e.expenses)==null?void 0:y.map((i,c)=>s("div",{children:a(m,{to:l("/expenses/:id/edit",{id:i.id}),children:[t("expense")," #",i.number]})},c))]})]})}),s(Te,{project:e}),s(je,{project:e}),s("div",{className:"col-span-12 md:col-span-6 lg:col-span-3",children:a(d,{title:t("summary"),children:[a("p",{children:[t("active_tasks"),": ",(N=e.tasks)==null?void 0:N.length]}),a("p",{children:[t("total_hours"),": ",h(e.current_hours)]})]})})]}),P(le.Tasks)&&s("div",{className:"my-4",children:s(de,{resource:"task",columns:E,customActions:F,endpoint:`/api/v1/tasks?include=status,client,project&sort=id|desc&project_tasks=${e.id}&without_deleted_clients=true`,bulkRoute:"/api/v1/tasks/bulk",linkToCreate:`/tasks/create?project=${n}&rate=${e.task_rate}`,linkToEdit:"/tasks/:id/edit",showEdit:i=>D(i),customFilters:B,customBulkActions:R,customFilterPlaceholder:"status",withResourcefulActions:!0,leftSideChevrons:s(_e,{columns:M,defaultColumns:ue,table:"task"}),linkToCreateGuards:[me("create_task")],hideEditableOptions:!v("edit_task")})}),s(pe,{entity:"project",entities:L,visible:H,setVisible:I,labelFn:i=>`${t("number")}: ${i.number}`,bulkUrl:"/api/v1/projects/bulk"})]}):s(T,{title:o,breadcrumbs:b,children:s(ne,{})})}export{Ee as default};
cải xoăn