import{u as c,j as s,b8 as d,v as o}from"./vendor-BKmmeuxg.js";import{B as t}from"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";const j=()=>{const{props:i}=c(),r=i.watching.resources,n=async(e,a)=>{a.preventDefault();try{const l=route("resources.download",e.id);window.open(l,"_blank")}catch{window.open(e.resource,"_blank")}};return s.jsx("div",{className:"space-y-5",children:r.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(t,{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(t,{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};