import{u as f}from"./vue-router-7f882520.js";import{v,l as x,ak as h,$ as g,o as k,af as N}from"./index-ae60edf9.js";import{d as w,o as t,c as a,a as o,O as y,aX as c,u as n,P as C}from"./@vue-cb50a1c4.js";const D={class:"flex flex-1 items-center overflow-hidden"},I=["src"],p={class:"ml-2 flex-1 overflow-hidden"},B={class:"flex items-baseline"},S={class:"max-w-[200px] truncate"},M={class:"max-w-[200px] truncate text-xs text-[#999]"},T={key:0,class:"text-xs text-[#adadad]"},L=w({__name:"GlobalSearchResult",props:{source:null,preview:{type:Boolean},conversationName:null,conversationID:null,isFile:{type:Boolean}},emits:[],setup(e,{emit:U}){const s=e,r=f(),i=v(),u=x(),l=h(s.source.sendTime),m=s.source.clientMsgID?g(s.source):"",d=()=>{if(s.preview){r.push({path:"previewHistoryMessage",state:{conversationID:s.conversationID,conversationName:s.conversationName,jumpMessage:JSON.stringify(s.source)}});return}if(s.source.userID){i.getUserCardData(s.source.userID);return}if(s.source.groupName){u.updateCurrentGroupInfo(s.source),r.push({path:"groupCard"});return}s.source.fileElem&&N(s.source.fileElem.sourceUrl,s.source.fileElem.fileName)};return(E,F)=>(t(),a("div",{onClick:d,class:"relative flex bg-white px-4 py-[10px]"},[o("div",D,[e.isFile?(t(),a("img",{key:1,class:"h-[44px] w-[38px]",src:e.source.faceURL,alt:""},null,8,I)):(t(),y(k,{key:0,src:e.source.faceURL||e.source.senderFaceUrl,desc:e.source.nickname||e.source.showName||e.source.senderNickname,isGroup:e.source.groupID!==void 0&&!e.source.senderNickname,size:42},null,8,["src","desc","isGroup"])),o("div",p,[o("div",B,[o("div",S,c(e.source.nickname||e.source.groupName||e.source.showName||e.source.senderNickname),1)]),o("div",M,c(e.source.latestMsg||n(m)),1)])]),e.source.sendTime!==void 0?(t(),a("div",T,c(n(l)),1)):C("",!0)]))}});export{L as _};
