Build 545032stable
Module 815332
1,169 characters · in 06bc175fe5814405.jsDependencies
Source Raw
function(e,n,t){t.d(n,{A:()=>h});var s=t(627968),i=t(64700),a=t(989349),r=t.n(a),l=t(793574),c=t(688810),u=t(753390),o=t(599941),d=t(322092),m=t(375708);function h(e){let{groupListingId:n,subscription:t,className:a}=e,{analyticsLocations:h}=(0,c.Ay)(l.A.PENDING_PLAN_CHANGE_NOTICE),{resetRenewalMutation:x,submitting:p,error:g}=(e=>{let[n,t]=i.useState(!1),[s,a]=i.useState(null);return{resetRenewalMutation:async n=>{t(!0),a(null);try{await (0,u.ZK)(n,e)}catch(e){a(e)}finally{t(!1)}},submitting:n,error:s}})(h),j=(0,o.cY)(n,{includeSoftDeleted:!0}),{currentListing:v,nextListing:N}=i.useMemo(()=>{if(t?.renewalMutations==null)return{currentListing:void 0,nextListing:void 0};let e=t.items[0].planId,n=t.renewalMutations.items[0].planId;return{currentListing:j.find(n=>n.subscription_plans[0].id===e),nextListing:j.find(e=>e.subscription_plans[0].id===n)}},[t,j]);if(null==t||null==v||null==N)return null;let f=r()(t.currentPeriodEnd).format("MMM DD, YYYY");return(0,s.jsx)(d.A,{message:m.intl.format(m.t.chw89X,{currentListing:v.name,nextListing:N.name,changeDate:f}),error:g?.message,onClick:()=>x(t),submitting:p,ctaMessage:m.intl.string(m.t.De4wI8),className:a})}}