import{I as e,J as t,R as n,S as r,T as i,a,ht as o,l as s,mt as c,pt as l,r as u,v as d,w as f,x as p}from"./folders.j8Vf02Wn.js";import{n as m}from"./style.BtGWTIRi.js";var h={class:`absolute top-2 left-2 z-10`},g=[`checked`],_={class:`ml-5 flex items-start gap-2`},v={class:`flex-shrink-0`},y=[`src`],b={key:1,class:`flex h-4 w-4 items-center justify-center rounded-sm bg-accent text-xs`},x={class:`flex-1 min-w-0`},S={class:`flex items-start justify-between gap-2`},C={class:`flex-1`},w=[`href`,`title`],T={class:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`},E={key:0,class:`badge bg-accent text-primary`},D={key:0,class:`mt-1 flex flex-wrap gap-1`},O={__name:`LinkCard`,props:{link:{type:Object,required:!0},selected:{type:Boolean,default:!1},viewMode:{type:String,default:`list`}},emits:[`toggle-select`,`toggle-star`,`open`,`edit`],setup(O,{emit:k}){let A=u(),j=p(()=>e=>A.tagMap.get(e)?.name||``),M=p(()=>e=>A.tagMap.get(e)?.color||`#6b7280`);return(u,p)=>(e(),i(`div`,{class:l([`link-card relative rounded-lg border border-border bg-background p-3 text-sm transition-colors hover:bg-accent/30`,{"ring-2 ring-primary":O.selected}])},[r(`div`,h,[r(`input`,{type:`checkbox`,checked:O.selected,onChange:p[0]||=e=>u.$emit(`toggle-select`),class:`h-3 w-3 cursor-pointer`},null,40,g)]),r(`div`,_,[r(`div`,v,[O.link.favicon&&O.link.type!==t(s).PRODUCT?(e(),i(`img`,{key:0,src:O.link.favicon,alt:``,class:`h-4 w-4 rounded-sm`,onError:p[1]||=(...e)=>t(m)&&t(m)(...e)},null,40,y)):!O.link.favicon||O.link.type===t(s).PRODUCT?(e(),i(`div`,b,o(O.link.favicon?`🖼️`:`📄`),1)):f(``,!0)]),r(`div`,x,[r(`div`,S,[r(`div`,C,[r(`a`,{href:O.link.url,onClick:p[2]||=e=>{u.$emit(`open`),e.preventDefault()},class:`font-medium text-foreground hover:underline cursor-pointer line-clamp-1`,title:O.link.title},o(O.link.title),9,w),r(`div`,T,[r(`span`,null,o(t(a)(O.link.url)),1),p[4]||=r(`span`,null,`•`,-1),r(`span`,null,o(new Date(O.link.createdAt).toLocaleDateString()),1),O.link.type===t(s).PRODUCT?(e(),i(`span`,E,` product `)):f(``,!0)])]),r(`button`,{onClick:p[3]||=e=>u.$emit(`toggle-star`),class:l([`flex-shrink-0`,{"text-primary":O.link.starred}]),title:`Toggle star`},o(O.link.starred?`⭐`:`☆`),3)]),O.link.tags?.length?(e(),i(`div`,D,[(e(!0),i(d,null,n(O.link.tags,t=>(e(),i(`span`,{key:t,class:`badge text-xs`,style:c({backgroundColor:M.value(t)+`20`,color:M.value(t)})},o(j.value(t)),5))),128))])):f(``,!0)])])],2))}};export{O as t};