-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6187.js
1 lines (1 loc) · 2.36 KB
/
6187.js
1
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[6187],{96609:(e,t,s)=>{s.d(t,{TopCommentsCard:()=>N});var n=s(30758),i=s(85387),o=s(60749),a=s(61e3),l=s(21974),r=s(72574),c=s(93492),m=s(71429),u=s(65652),d=s(814),p=s(46710),b=s(55037),h=s(58897);var y=s(50974),C=s(3864),g=s(28616),f=s(4586),j=s(8267);const w="jmVy04VnzhcDZbU5PDSR",k="dkV2Y3wOToyBbzjsYFDE",v="Art4GUNuIb1DIs1FlRRq",x="cTMTF6fQBMbj8gVHfp5t",R="WWXdDi6SRZBkgybtn0aT";var S=s(86070);const T=({topCommentsResponse:e,entityUri:t})=>{const s=(0,i.Zp)(),p=(0,i.zy)(),[b]=(0,o.ok)(),{mainContentRef:h}=(0,u.JT)(),{logCommentsNPVCardImpression:T}=(0,f._)();(0,n.useEffect)((()=>{T(t)}),[]);const N=(0,n.useCallback)((e=>{const n=(0,r.o_h)(t)?.toURLPath(!0);n&&(p.pathname===n&&b.get("id")===e?h.current?.querySelector(`[data-comment-id="${e}"]`)?.scrollIntoView({block:"start",behavior:"smooth"}):s({pathname:n,search:(0,o.PI)({id:e}).toString()}))}),[p.pathname,h,s,b,t]),{isRestricted:U}=(0,j.K)(e.eligibilityStatus),I=(0,n.useMemo)((()=>e.comments.filter((e=>!e.isSensitive))),[e]),V=(0,n.useMemo)((()=>e.comments.filter((e=>e.isSensitive))),[e]);return(0,S.jsxs)(d.w,{className:w,children:[(0,S.jsx)(d.X,{className:k,action:(0,S.jsx)(a.H,{size:"small",condensed:!0,semanticColor:"textSubdued",onClick:()=>N("top"),children:c.Ru.get("web-player.user-comments.top-comment-card-header.count",e.totalCount)}),children:c.Ru.get("web-player.user-comments.comments")}),e.totalCount>0&&(0,S.jsx)(m.a,{className:x,children:(0,S.jsxs)("div",{className:R,children:[I.map(((e,s)=>(0,S.jsx)(C.c,{comment:e,entityUri:t,showSeparator:s>0,lineClamp:2,onClickNavigate:N},`${e.uri}-${s}`))),(0,S.jsx)(g.U,{sensitiveComments:V,entityUri:t,navigateOnShowAll:N})]})}),(0,S.jsx)("div",{className:v,children:U?(0,S.jsx)(y.K,{eligibility:e.eligibilityStatus}):(0,S.jsx)(l.n,{size:"small",onClick:()=>N("new"),children:c.Ru.get("web-player.user-comments.comment-input.leave-comment")})})]})},N=({uri:e})=>{const{data:t}=(e=>{const t=(0,h.n)(),{data:s,isLoading:n,isError:i}=(0,p.I)({queryKey:b.K.topComments(e),queryFn:async()=>await t.getTopComments(e),gcTime:36e5,staleTime:3e4});return{data:s,isLoading:n,isError:i}})(e);if(!t||0===t.totalCount)return null;const{isHidden:s}=(0,j.K)(t.eligibilityStatus);return s?null:(0,S.jsx)(T,{topCommentsResponse:t,entityUri:e})}}}]);