PageSourceSearch

https://adamhanczyn.pl/assets/procedury.zespol-btL3NmsF.js

js adamhanczyn.pl collected 2026-10-08 07:35:46 UTC 3,372 bytes, 1 lines download raw bytes

1import{l as w,o as r,A as n,k as i,z as s,w as e,X as N}from"./index-Dp6vgdCm.js";import{L as k}from"./loader-circle-CciwRn0E.js";const S=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],z=w("user-plus",S),E=r({method:"GET"}).middleware([n]).handler(i("f4e50b032b39321fe68c966170934321bc97f94ac713430d2d0ebedf800ff0bb")),P=r({method:"POST"}).middleware([n]).handler(i("bc857c138f9ac67c961303251619a87867c42eefb9f3712a7ea104a0b6231e58")),A=r({method:"POST"}).middleware([n]).handler(i("8dfd4bddac2e3613f02da2e38612573c3459b2dbdee30f495bcce4d9e6709ee3"));function T(){const[f,b]=s.useState([]),[h,c]=s.useState(!0),[d,l]=s.useState(""),[o,y]=s.useState("member"),[m,u]=s.useState(!1),[x,p]=s.useState(null),t=async()=>{c(!0),b(await E()),c(!1)};s.useEffect(()=>{t()},[]);const j=async a=>{a.preventDefault(),u(!0),p(null);try{await P({data:{email:d,role:o}}),l(""),t()}catch(g){p(g.message)}finally{u(!1)}},v=async a=>{confirm("Usunąć tę osobę z firmy?")&&(await A({data:{id:a}}),t())};return e.jsxs("div",{className:"mx-auto max-w-3xl px-6 lg:px-10 py-12",children:[e.jsx("span",{className:"eyebrow",children:"Zespół"}),e.jsx("h1",{className:"mt-4 text-3xl font-bold",children:"Pracownicy firmy"}),e.jsxs("form",{onSubmit:j,className:"card p-5 mt-8 flex flex-wrap gap-3 items-end",children:[e.jsxs("label",{className:"flex-1 min-w-[200px] block",children:[e.jsx("span",{className:"text-[0.85rem] text-foreground-muted",children:"Email do zaproszenia"}),e.jsx("input",{type:"email",required:!0,value:d,onChange:a=>l(a.target.value),className:"mt-1 w-full px-4 py-3 rounded-[12px] bg-surface border border-border focus:border-accent outline-none"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[0.85rem] text-foreground-muted",children:"Rola"}),e.jsxs("select",{value:o,onChange:a=>y(a.target.value),className:"mt-1 px-4 py-3 rounded-[12px] bg-surface border border-border outline-none",children:[e.jsx("option",{value:"member",children:"Pracownik"}),e.jsx("option",{value:"admin",children:"Admin"})]})]}),e.jsxs("button",{disabled:m,className:"btn-primary inline-flex items-center gap-2",children:[m?e.jsx(k,{size:16,className:"animate-spin"}):e.jsx(z,{size:16})," Zaproś"]})]}),x&&e.jsx("div",{className:"mt-3 text-sm text-red-400 bg-red-500/10 border border-red-500/30 rounded-md p-3",children:x}),e.jsx("p",{className:"mt-2 text-[0.8rem] text-foreground-dim",children:"Wysyłka maila z linkiem akceptacji zostanie uruchomiona w Etapie 2."}),e.jsx("div",{className:"mt-10 space-y-3",children:h?e.jsx("div",{className:"text-foreground-muted",children:"Ładuję..."}):f.map(a=>e.jsxs("div",{className:"card p-4 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a.invited_email??a.user_id??"—"}),e.jsxs("div",{className:"text-[0.8rem] text-foreground-dim",children:[a.role==="owner"?"Właściciel":a.role==="admin"?"Admin":"Pracownik"," · ",a.inv
1itation_status==="pending"?"Zaproszenie wysłane":"Aktywny"]})]}),a.role!=="owner"&&e.jsx("button",{onClick:()=>v(a.id),className:"text-foreground-dim hover:text-red-400 p-2",children:e.jsx(N,{size:16})})]},a.id))})]})}export{T as component};

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.