Files
ambersplace.net/cohost-archive/static/client-preact-components-pages-moderation-manage-page-queue-for-purge.adab6a236a09bccd1b1f.js

2 lines
5.0 KiB
JavaScript

"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[125],{2735:function(e,r,t){t.d(r,{Qj:function(){return j},zx:function(){return N}});var o=t(65443),n=t.n(o),a=t(94159),l=t(6285);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},c.apply(this,arguments)}const s=l.z.enum(["pill","roundrect","authn"]),i=l.z.enum(["cherry","strawberry","mango","not-black","red","green","accent","secondary","authn-primary","authn-other"]),d=(l.z.object({buttonStyle:s,color:i,className:l.z.string().optional()}),n()("bg-notWhite","hover:text-notWhite")),u=n()("font-atkinson","font-bold","rounded-full","border-2"),b=n()("body-2","rounded-lg"),g=n()("flex","h-12","items-center","justify-center","rounded-lg","px-6","text-lg"),h=n()("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),f=n()("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),m=n()("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),y=n()("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),p=n()("border-mango","hover:bg-mango","text-mango","bg-notBlack","hover:text-notBlack"),v=n()("border-notBlack","hover:bg-notBlack","text-notBlack","focus:outline-notBlack","focus:ring-notBlack",d),w=n()("border-accent","text-accent","bg-foreground","hover:bg-accent","hover:text-text"),x=n()("bg-secondary","text-notWhite","dark:text-notBlack","hover:bg-secondary-600"),E=n()("bg-foreground","text-text","hover:bg-foreground-600","active:bg-foreground-700","disabled:bg-foreground-200"),S=n()("border-2","border-foreground","text-foreground","hover:bg-longan-200"),k=e=>n()("leading-none","align-middle","py-2","px-4","no-select",e.className,{[u]:"pill"===e.buttonStyle,[b]:"roundrect"===e.buttonStyle,[g]:"authn"===e.buttonStyle,[h]:"cherry"===e.color,[f]:"strawberry"===e.color,[p]:"mango"===e.color,[v]:"not-black"===e.color,[m]:"red"===e.color,[w]:"accent"===e.color,[y]:"green"===e.color,[x]:"secondary"===e.color,[E]:"authn-primary"===e.color,[S]:"authn-other"===e.color}),N=a.forwardRef((({buttonStyle:e,color:r,className:t,...o},n)=>{const l=k({buttonStyle:e,color:r,className:t,...o});return a.createElement("button",c({},o,{className:l,ref:n}),o.children)}));N.displayName="Button";const j=a.forwardRef((({buttonStyle:e,color:r,...t},o)=>{const n=k({buttonStyle:e,color:r,...t});return a.createElement("a",c({},t,{className:n,ref:o}),t.children)}));j.displayName="LinkButton"},85473:function(e,r,t){t.r(r),t.d(r,{QueueForPurgeForm:function(){return d}});var o=t(94159),n=t(99838),a=t(2735),l=t(70496),c=t(71860),s=t(84879);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},i.apply(this,arguments)}const d=({project:e})=>{const{register:r,handleSubmit:t,watch:d}=(0,n.cI)(),u=d(),b=c.S.moderation.project.queueForPurge.useMutation();return o.createElement("form",{className:"flex max-w-fit flex-col gap-2 rounded-lg border border-accent p-3",onSubmit:t((async()=>{await b.mutateAsync({projectId:e.projectId})}))},o.createElement("h4",{className:"h4"},"queue page for purge"),o.createElement(l.v,{level:"warning",className:"prose"},o.createElement("p",null,o.createElement("b",null,"HEADS UP!")," This will start a timer to perform the following irreverseable operations, at some time within 24 hours of ",s.ou.now().plus({days:3}).toString(),":",o.createElement("ul",null,o.createElement("li",null,"hard-delete all of this page's posts without shares;"),o.createElement("li",null,"transfer all of this page's posts with shares to @deactivated and soft-delete them;"),o.createElement("li",null,"hard-delete all of this page's comments without replies;"),o.createElement("li",null,"transfer all of this page's comments with replies to @deactivated and soft-delete them;"),o.createElement("li",null,"hard-delete this page and its relationships."))),o.createElement("p",null,"The editor(s) of this page will be able to cancel the queued deletion, if it was mistaken or they change their mind.")),o.createElement("label",null,"I've read the warnings and I'm still gonna do it:"),o.createElement("input",i({type:"checkbox"},r("confirmed",{required:!0}))),o.createElement(a.zx,{type:"submit",buttonStyle:"pill",color:"cherry",className:"w-fit",disabled:!u.confirmed},"queue page for purge"))}}}]);
//# sourceMappingURL=client-preact-components-pages-moderation-manage-page-queue-for-purge.adab6a236a09bccd1b1f.js.map