2 lines
5.6 KiB
JavaScript
2 lines
5.6 KiB
JavaScript
"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[9278],{2735:function(e,t,r){r.d(t,{Qj:function(){return B},zx:function(){return S}});var n=r(65443),a=r.n(n),o=r(94159),c=r(6285);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}const i=c.z.enum(["pill","roundrect","authn"]),s=c.z.enum(["cherry","strawberry","mango","not-black","red","green","accent","secondary","authn-primary","authn-other"]),d=(c.z.object({buttonStyle:i,color:s,className:c.z.string().optional()}),a()("bg-notWhite","hover:text-notWhite")),b=a()("font-atkinson","font-bold","rounded-full","border-2"),m=a()("body-2","rounded-lg"),u=a()("flex","h-12","items-center","justify-center","rounded-lg","px-6","text-lg"),g=a()("border-cherry","hover:bg-cherry","text-cherry","active:bg-cherry-600","active:border-cherry-600","disabled:text-cherry-300","disabled:border-cherry-300","focus:outline-cherry","focus:ring-cherry",d),h=a()("border-strawberry","hover:bg-strawberry","text-strawberry","active:bg-strawberry-600","active:border-strawberry-600","disabled:text-strawberry-300","disabled:border-strawberry-300","focus:outline-strawberry","focus:ring-strawberry",d),f=a()("border-red","hover:bg-red","text-red","active:bg-red-600","active:border-red-600","disabled:text-red-300","disabled:border-red-300","focus:outline-red",d),v=a()("border-green","hover:bg-green","text-green","active:bg-green-600","active:border-green-600","disabled:text-green-300","disabled:border-green-300","focus:outline-green",d),y=a()("border-mango","hover:bg-mango","text-mango","bg-notBlack","hover:text-notBlack"),p=a()("border-notBlack","hover:bg-notBlack","text-notBlack","focus:outline-notBlack","focus:ring-notBlack",d),x=a()("border-accent","text-accent","bg-foreground","hover:bg-accent","hover:text-text"),E=a()("bg-secondary","text-notWhite","dark:text-notBlack","hover:bg-secondary-600"),w=a()("bg-foreground","text-text","hover:bg-foreground-600","active:bg-foreground-700","disabled:bg-foreground-200"),N=a()("border-2","border-foreground","text-foreground","hover:bg-longan-200"),k=e=>a()("leading-none","align-middle","py-2","px-4","no-select",e.className,{[b]:"pill"===e.buttonStyle,[m]:"roundrect"===e.buttonStyle,[u]:"authn"===e.buttonStyle,[g]:"cherry"===e.color,[h]:"strawberry"===e.color,[y]:"mango"===e.color,[p]:"not-black"===e.color,[f]:"red"===e.color,[x]:"accent"===e.color,[v]:"green"===e.color,[E]:"secondary"===e.color,[w]:"authn-primary"===e.color,[N]:"authn-other"===e.color}),S=o.forwardRef((({buttonStyle:e,color:t,className:r,...n},a)=>{const c=k({buttonStyle:e,color:t,className:r,...n});return o.createElement("button",l({},n,{className:c,ref:a}),n.children)}));S.displayName="Button";const B=o.forwardRef((({buttonStyle:e,color:t,...r},n)=>{const a=k({buttonStyle:e,color:t,...r});return o.createElement("a",l({},r,{className:a,ref:n}),r.children)}));B.displayName="LinkButton"},99718:function(e,t,r){r.r(t),r.d(t,{ManageInvites:function(){return s}});var n=r(12093),a=r(46202),o=r(84879),c=r(94159),l=r(90275),i=r(2735);const s=({activeInvites:e})=>c.createElement(c.Fragment,null,c.createElement(l.ql,{title:"manage invites"}),c.createElement("div",{className:"flex flex-col gap-4 prose-headings:m-0"},c.createElement("h1",null,"invite management page"),c.createElement("a",{href:n.ZP.public.moderation.home().toString()},c.createElement(a.Z,{className:"inline h-6 w-6"}),"back to moderation home"),c.createElement("form",{className:"flex max-w-fit flex-col gap-2 rounded-lg border border-accent p-3",method:"post",action:n.ZP.public.invites.create().toString()},c.createElement("h2",{className:"text-xl"},"create a new invite"),c.createElement("div",{className:"flex flex-row items-center gap-2"},c.createElement("label",{htmlFor:"nUserActivations"},"number of user activations"),c.createElement("input",{type:"number",min:1,max:999,step:1,defaultValue:1,name:"nUserActivations"})),c.createElement(i.zx,{type:"submit",color:"cherry",buttonStyle:"pill"},"create a new invite")),c.createElement("h2",{className:"text-xl"},"active invites"),c.createElement("table",{className:"max-w-fit table-auto whitespace-nowrap text-center"},c.createElement("thead",{className:"border-b border-gray"},c.createElement("tr",null,c.createElement("th",{className:"p-3",scope:"col"},"invite ID"),c.createElement("th",{scope:"col",className:"p-3"},"uses remaining"),c.createElement("th",{scope:"col",className:"p-3"},"created at"))),c.createElement("tbody",null,e.map((e=>{const t=n.ZP.public.invites.activate({inviteId:e.inviteId});return c.createElement("tr",{key:e.inviteId,className:"border-b border-gray"},c.createElement("td",{className:"p-3"},c.createElement("a",{href:t.toString()},e.inviteId)),c.createElement("td",{className:"p-3"},e.userActivationsRemaining),c.createElement("td",{className:"p-3"},o.ou.fromISO(e.createdAt).toUTC().toLocaleString({...o.ou.DATETIME_MED,timeZoneName:"short"})))}))))));s.displayName="moderation/manage-invites",t.default=s},46202:function(e,t,r){var n=r(94159);const a=n.forwardRef((function({title:e,titleId:t,...r},a){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:a,"aria-labelledby":t},r),e?n.createElement("title",{id:t},e):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"}))}));t.Z=a}}]);
|
|
//# sourceMappingURL=client-preact-components-pages-moderation-manage-invites.d756c7b0186cbf5ad5c7.js.map
|