import{u as r,j as s,c3 as d,t as o}from"./vendor-rThclpOQ.js";import{B as l}from"./button-ZcsoqUQn.js";import"./index-DquVdLUg.js";import"./utils-8KAaAB9H.js";const j=()=>{const{props:i}=r(),c=i.watching.resources,n=async(e,a)=>{a.preventDefault();try{const t=route("resources.download",e.id);window.open(t,"_blank")}catch{window.open(e.resource,"_blank")}};return s.jsx("div",{className:"space-y-5",children:c.map(e=>e.type==="link"?s.jsx("div",{className:"bg-muted rounded-md p-1.5",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"w-full px-1",children:s.jsx("a",{target:"_blank",href:e.resource,className:"cursor-pointer text-sm hover:underline",children:e.title.slice(0,50)+(e.title.length>50?"...":"")})}),s.jsx(l,{asChild:!0,size:"icon",variant:"secondary",className:"h-7 w-7",children:s.jsx("a",{target:"_blank",href:e.resource,children:s.jsx(d,{className:"h-3 w-3"})})})]},e.id)}):s.jsx("div",{className:"bg-muted rounded-md p-1.5",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"w-full px-1",children:s.jsx("span",{className:"cursor-pointer text-sm hover:underline",onClick:a=>n(e,a),children:e.title.slice(0,50)+(e.title.length>50?"...":"")})}),s.jsx(l,{size:"icon",variant:"secondary",className:"h-7 w-7",onClick:a=>n(e,a),children:s.jsx(o,{className:"h-3 w-3"})})]},e.id)}))})};export{j as default};
