PageSourceSearch

https://asimila.ai/assets/EditRosterDialog-CTdNCWhL.js

js asimila.ai collected 2026-10-05 11:51:45 UTC 2,562 bytes, 1 lines download raw bytes

1import{r as s,j as e}from"./ui-vendor-Bm6fxeW1.js";import{a as r,bc as i,bd as t,W as n,aZ as a,a_ as o,a$ as d,b1 as c,b2 as l,M as m,B as u,be as h,L as j,r as p,x}from"./main-DFsKVC_z.js";import{R as f}from"./RosterForm-BslTWL7j.js";import"./query-vendor-COZ_T4D3.js";import"./react-vendor-Doh2abh7.js";import"./date-vendor-DYafMXNK.js";const b=({open:b,onOpenChange:v,rosterId:g,onDelete:y})=>{const{t:C}=r(),N=i(),w=t(),[L,R]=s.useState(!1),{data:I,isLoading:D}=n(g,{enabled:b&&void 0!==g});if(D||!I)return e.jsx(a,{open:b,onOpenChange:v,children:e.jsxs(o,{className:"sm:max-w-[525px]",children:[e.jsxs(d,{children:[e.jsx(c,{children:C("rosters.editRoster")}),e.jsx(l,{children:C("rosters.editDescription")})]}),e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"text-muted-foreground",children:C("common.loading")})})]})});const F="draft"===I.publication_status;return e.jsxs(e.Fragment,{children:[e.jsx(a,{open:b,onOpenChange:v,children:e.jsxs(o,{className:"max-w-2xl",children:[e.jsx(d,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(c,{children:C("rosters.editRoster")}),e.jsx(l,{children:C("rosters.editDescription")})]}),e.jsx(m,{variant:F?"secondary":"default",children:C(F?"rosters.status.draft":"rosters.status.published")})]})}),e.jsx(f,{defaultValues:{name:I.name,description:I.description},onSubmit:async s=>{if(I)try{await N.mutateAsync({id:I.id,data:s}),x.info("Roster updated successfully",{rosterId:I.id}),v(!1)}catch(e){x.error("Failed to update roster",{error:e,rosterId:I.id})}},onCancel:()=>{v(!1)},isSubmitting:N.isPending,submitLabel:C("common.save")}),e.jsx("div",{className:"border-t pt-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[y?e.jsxs(u,{variant:"destructive",size:"sm",onClick:y,children:[e.jsx(h,{className:"mr-2 h-4 w-4"}),C("common.delete")]}):e.jsx("div",{}),F&&e.jsxs(u,{variant:"default",size:"sm",onClick:()=>R(!0),disabled:w.isPending,children:[w.isPending&&e.jsx(j,{className:"mr-2 h-4 w-4 animate-spin"}),C("rosters.publish")]})]})})]})}),e.jsx(p,{open:L,onOpenChange:R,title:C("rosters.publishConfirmTitle"),description:C("rosters.publishConfirmDescription"),cancelLabel:C("common.cancel"),confirmLabel:C("rosters.publish"),isLoading:w.isPending,onConfirm:async()=>{if(I)try{await w.mutateAsync(I.id),x.info("Roster published successfully",{rosterId:I.id}),R(!1)}catch(s){x.error("Failed to publish roster",{error:s,rosterId:I.id})}}})]})};export{b as EditRosterDialog};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.