dotfiles/.config/spicetify/Extracted/Themed/xpui/xpui-routes-recent-searches.js

2 lines
1.7 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[8785],{53467:(e,s,a)=>{a.r(s),a.d(s,{default:()=>m});var c=a(84875),r=a.n(c),t=a(36844),n=a(3802),l=a(59496),h=a(89605),i=a(56162),o=a(38260),d=a(92211),g=a(98340),u=a(96170),p=a(5488),j=a(21789);const x="Ul_eSpTV7OKDhvXcgfzw",f="HFNTjI36ujrPacyLOwTT";var y=a(4637);const v=()=>{const{searchHistory:e,clearSearchHistory:s}=(0,j.u)(),a=(0,h.s0)(),{spec:c,logger:r,UBIFragment:t}=(0,u.fU)(o.createDesktopRecentSearchesEventFactory,{data:{uri:"spotify:app:recent-searches"}}),v=(0,l.useMemo)((()=>c.recentSearchesCardsFactory()),[c]),b=(0,l.useCallback)((()=>{const e=c.clearButtonFactory().hitClearRecentSearches();r.logInteraction(e),s(),a("/search")}),[s,r,a,c]),k=(0,l.useCallback)((c=>{const r=e.length;s(c),1===r&&a("/search")}),[s,a,e.length]);return 0===e.length?null:(0,y.jsxs)("div",{className:x,children:[(0,y.jsx)(t,{spec:v,children:(0,y.jsx)(p.P,{title:n.ag.get("search.title.recent-searches"),showAll:!0,children:e.map(((e,s)=>(0,y.jsx)(g.ZP,{index:s,value:"search-history",children:(0,y.jsx)(d.q,{clearSearchHistory:k,entity:e,index:s})},e.uri)))})}),(0,y.jsx)("button",{onClick:b,className:f,children:(0,y.jsx)(i.D,{variant:"mestoBold",children:n.ag.get("search.clear-recent-searches")})})]})};var b=a(41836),k=a(91703),w=a(73616);const m=()=>{const e=(0,t.W6)(b.Dz);return(0,y.jsxs)(g.ZP,{value:"search-page",children:[(0,y.jsx)(k.$,{children:n.ag.get("search.page-title")}),(0,y.jsx)("div",{className:r()("contentSpacing",{[w.Z.narrowPage]:e}),id:"searchPage",children:(0,y.jsx)(v,{})})]})}}}]);
//# sourceMappingURL=xpui-routes-recent-searches.js.map