PageSourceSearch

https://newsletter.remoteur.com/assets/CommunityMemberActionsProvider-RbKU5frW.js

js remoteur.com collected 2026-09-24 13:25:09 UTC 5,178 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f63e93c6-5f08-5757-b91b-d3e604a864dc")}catch(e){}}();
3import{s as e,t}from"./jsx-runtime-D4ePz0Hl.js";import{t as n}from"./react-BXH-GOAS.js";import{R as r}from"./components-CDo3yjgw.js";import{t as i}from"./useTranslation-xRzBcOIb.js";import{t as a}from"./classnames-B9Sa-P4w.js";import{i as o}from"./MemberProfileLink-DTH-ashB.js";import{t as s}from"./ConfirmDialog-qJ2hzKOi.js";import{n as c,t as l}from"./FieldStatus-BWwBjk7F.js";import{t as u}from"./useBlockMemberMutation-DDCpl7S2.js";import{t as d}from"./useFollowMemberMutation-BdfyDxXq.js";var f=e(n(),1),p=e(a(),1),m=e(t(),1),h=({id:e,label:t,hideLabel:n=!1,error:r,className:i,containerClassName:a,rows:o=3,...s})=>{let u=c({id:e,error:r});return(0,m.jsxs)(`div`,{className:(0,p.default)(`flex flex-col gap-1.5`,a),children:[(0,m.jsx)(`label`,{htmlFor:e,className:(0,p.default)(n?`sr-only`:`text-[13px] font-medium leading-4 tracking-[-0.13px] text-black/70`),children:t}),(0,m.jsx)(`textarea`,{id:e,rows:o,"aria-invalid":r?!0:void 0,"aria-describedby":u,className:(0,p.default)(`w-full resize-none rounded-xl border bg-white px-3 py-2 text-sm text-black placeholder:text-black/40 focus:outline-none focus:ring-2 disabled:opacity-60`,r?`border-red-500 focus:border-red-500 focus:ring-red-500/20`:`border-black/10 focus:ring-black/20`,i),...s}),(0,m.jsx)(l,{id:e,error:r})]})},g=({isOpen:e,onConfirm:t,onCancel:n,memberName:r,isLoading:a=!1})=>{let{t:o}=i(),[c,l]=(0,f.useState)(``);return(0,m.jsx)(s,{isOpen:e,title:o(`community.action_menu.ban_member_confirm_title`,{memberName:r}),description:o(`community.action_menu.ban_member_confirm_description`),confirmLabel:o(`community.action_menu.ban_member_confirm_button`),onConfirm:()=>{t(c.trim()||void 0)},onCancel:n,isDestructive:!0,isLoading:a,body:(0,m.jsx)(h,{id:`ban-member-reason`,label:o(`community.action_menu.ban_member_reason_placeholder`),hideLabel:!0,placeholder:o(`community.action_menu.ban_member_reason_placeholder`),value:c,onChange:e=>l(e.target.value),disabled:a,containerClassName:`mt-4`})})},_=({isOpen:e,onConfirm:t,onCancel:n,memberName:r,isLoading:a=!1})=>{let{t:o}=i();return(0,m.jsx)(s,{isOpen:e,title:o(`community.action_menu.block_member_confirm_title`,{memberName:r}),description:o(`community.action_menu.block_member_confirm_description`),confirmLabel:o(`community.action_menu.block_member_confirm_button`),onConfirm:t,onCancel:n,isDestructive:!0,isLoading:a})},v=`/ban_community_member`,y=()=>o({buildRequest:({memberId:e,reason:t})=>({path:v,fields:{member_id:e,...t?{reason:t}:{}}})}),b=`/unban_community_member`,x=()=>o({buildRequest:({memberId:e})=>({path:b,fields:{member_id:e}})}),S=(0,f.createContext)(null),C=()=>{let e=(0,f.useContext)(S);if(!e)throw Error(`useCommunityMemberActions must be used within CommunityMemberActionsProvider`);return e},w=({children:e})=>{let{t}=i(),{revalidate:n}=r(),[a,o]=(0,f.useState)(null),[c,l]=(0,f.useState)(new Set),p=(0,f.useRef)(!1),h=y(),v=x(),b=u(),C=d(),w=()=>o(null),T=(0,f.useMemo)(()=>({openBanDialog:e=>o({type:`ban`,member:e}),openUnbanDialog:e=>o({type:`unban`,member:e}),openBlockDialog:e=>o({type:`block`,member:e}),openUnblockDialog:e=>o({type:`unblock`,member:e}),toggleFollow:(e,t,r)=>{l(t=>new Set(t).add(e.id)),C.mutate({memberId:e.id,follow:!t,pageBlock:r?.pageBlock},{onSuccess:()=>{n(),r?.onSuccess?.()},onSettled:()=>{l(t=>{let n=new Set(t);return n.delete(e.id),n}),r?.onSettled?.()}})},isFollowPending:e=>c.has(e)}),[C.mutate,c,n]),E=a?.member;return(0,m.jsxs)(S.Provider,{value:T,children:[e,(0,m.jsx)(s,{isOpen:a?.type===`unban`,title:t(`community.action_menu.unban_member_confirm_title`,{memberName:E?.name??``}),description:t(`community.action_menu.unban_member_confirm_description`),confirmLabel:t(`community.action_menu.unban_member_confirm_button`),onConfirm:()=>{E&&v.mutate({memberId:E.id},{onSuccess:()=>{w(),n()}})},onCancel:w,isLoading:v.isPending}),(0,m.jsx)(g,{isOpen:a?.type===`ban`,memberName:E?.name??``,onConfirm:e=>{E&&h.mutate({memberId:E.id,...e?{reason:e}:{}},{onSuccess:()=>{w(),n()}})},onCancel:w,isLoading:h.isPending},a?.type===`ban`?`ban-${E?.id}`:`ban-closed`),(0,m.jsx)(_,{isOpen:a?.type===`block`,memberName:E?.name??``,onConfirm:()=>{!E||p.current||(p.current=!0,b.mutate({memberId:E.id,block:!0},{onSuccess:()=>{w(),n()},onSettled:()=>{p.current=!1}}))},onCancel:w,isLoading:b.isPending}),(0,m.jsx)(s,{isOpen:a?.type===`unblock`,title:t(`community.action_menu.unblock_member_confirm_title`,{memberName:E?.name??``}),description:t(`community.action_menu.unblock_member_confirm_description`),confirmLabel:t(`community.action_menu.unblock_member_confirm_button`),onConfirm:()=>{!E||p.current||(p.current=!0,b.mutate({memberId:E.id,block:!1},{onSuccess:()=>{w(),n()},onSettled:()=>{p.current=!1}}))},onCancel:w,isLoading:b.isPending})]})};export{C as n,h as r,w as t};
4//# sourceMappingURL=CommunityMemberActionsProvider-RbKU5frW.js.map
5//# debugId=f63e93c6-5f08-5757-b91b-d3e604a864dc

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.