import{i as e,t}from"./jsx-runtime-ktpX_HJe.js";import{r as n,t as r}from"./Image-Cn5a1pql.js";import{t as i}from"./ArtistLinks-B-97h-o5.js";import{r as a}from"./utils-BRMsoFp5.js";var o=t();function s({listens:t,npData:s,showNP:c,hideArtists:l,onDelete:u}){let{user:d}=n(),f=`py-3 min-w-8 sm:min-w-11`,p=`text-(--color-fg-tertiary) pr-2 sm:pr-4 sm:text-sm`;return(0,o.jsx)(`table`,{className:`table border-collapse mt-6 w-full`,children:(0,o.jsxs)(`tbody`,{children:[c&&s&&(0,o.jsxs)(`tr`,{className:`group border-b border-(--color-bg-tertiary) relative last:border-b-0`,children:[(0,o.jsx)(`td`,{className:f,children:(0,o.jsx)(e,{to:`/track/${s.track.id}`,children:(0,o.jsx)(r,{src:s.track.image.small,size:32,alt:s.track.title,lazy:!0})})}),(0,o.jsx)(`td`,{className:`max-w-0 w-full px-2 py-2`,children:(0,o.jsxs)(`div`,{children:[!l&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i,{artists:s.track.artists}),` — `]}),(0,o.jsx)(e,{className:`hover:text-(--color-fg-secondary)`,to:`/track/${s.track.id}`,children:s.track.title})]})}),(0,o.jsx)(`td`,{className:p,children:(0,o.jsxs)(`div`,{className:`flex items-center justify-end gap-2 text-end`,children:[(0,o.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-(--color-primary)`}),`Now Playing`]})})]}),t.map(t=>(0,o.jsxs)(`tr`,{className:`group border-b border-(--color-bg-tertiary) relative last:border-b-0`,children:[(0,o.jsx)(`td`,{className:f,children:(0,o.jsx)(e,{to:`/track/${t.track.id}`,children:(0,o.jsx)(r,{src:t.track.image.small,size:32,alt:t.track.title})})}),(0,o.jsx)(`td`,{className:`max-w-0 w-full px-2 py-2`,children:(0,o.jsxs)(`div`,{children:[!l&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i,{artists:t.track.artists}),` — `]}),(0,o.jsx)(e,{className:`hover:text-(--color-fg-secondary)`,to:`/track/${t.track.id}`,children:t.track.title})]})}),(0,o.jsx)(`td`,{className:`text-end whitespace-nowrap ${p}`,title:new Date(t.time).toString(),children:a(new Date(t.time))}),(0,o.jsx)(`td`,{className:`hidden sm:table`,children:(0,o.jsx)(`button`,{onClick:()=>u(t),className:`absolute top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity text-(--color-fg-tertiary) hover:text-(--color-error)`,"aria-label":`Delete`,hidden:!d,children:`×`})})]},`last_listen_${t.time}`))]})})}export{s as t};