You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.3 KiB
JavaScript
2 lines
2.3 KiB
JavaScript
|
9 months ago
|
"use strict";exports.id=592,exports.ids=[592],exports.modules={66592:(e,t,a)=>{a.r(t),a.d(t,{ChatItem:()=>v,ChatList:()=>C});var s=a(95344),i=a(12670),n=a(84051),l=a.n(n),r=a(23463),c=a(33362),d=a(9719),o=a(17304),m=a(99608),h=a(86111),x=a(3729),p=a(6068),u=a(25166),j=a(56815);function v(e){let t=(0,x.useRef)(null);(0,x.useEffect)(()=>{e.selected&&t.current&&t.current?.scrollIntoView({block:"center"})},[e.selected]);let{pathname:a}=(0,o.TH)();return s.jsx(r._l,{draggableId:`${e.id}`,index:e.index,children:n=>(0,s.jsxs)("div",{className:(0,j.Z)(l()["chat-item"],{[l()["chat-item-selected"]]:e.selected&&(a===m.y$.Chat||a===m.y$.Home)}),onClick:e.onClick,ref:e=>{t.current=e,n.innerRef(e)},...n.draggableProps,...n.dragHandleProps,title:`${e.title}
|
||
|
|
${d.ZP.ChatItem.ChatItemCount(e.count)}`,children:[e.narrow?(0,s.jsxs)("div",{className:l()["chat-item-narrow"],children:[s.jsx("div",{className:(0,j.Z)(l()["chat-item-avatar"],"no-dark"),children:s.jsx(h.MaskAvatar,{avatar:e.mask.avatar,model:e.mask.modelConfig.model})}),s.jsx("div",{className:l()["chat-item-narrow-count"],children:e.count})]}):(0,s.jsxs)(s.Fragment,{children:[s.jsx("div",{className:l()["chat-item-title"],children:e.title}),(0,s.jsxs)("div",{className:l()["chat-item-info"],children:[s.jsx("div",{className:l()["chat-item-count"],children:d.ZP.ChatItem.ChatItemCount(e.count)}),s.jsx("div",{className:l()["chat-item-date"],children:e.time})]})]}),s.jsx("div",{className:l()["chat-item-delete"],onClickCapture:t=>{e.onDelete?.(),t.preventDefault(),t.stopPropagation()},children:s.jsx(i.Z,{})})]})})}function C(e){let[t,a,i,n]=(0,c.aK)(e=>[e.sessions,e.currentSessionIndex,e.selectSession,e.moveSession]),h=(0,c.aK)(),x=(0,o.s0)(),j=(0,u.S0)();return s.jsx(r.Z5,{onDragEnd:e=>{let{destination:t,source:a}=e;t&&(t.droppableId!==a.droppableId||t.index!==a.index)&&n(a.index,t.index)},children:s.jsx(r.bK,{droppableId:"chat-list",children:n=>(0,s.jsxs)("div",{className:l()["chat-list"],ref:n.innerRef,...n.droppableProps,children:[t.map((t,n)=>s.jsx(v,{title:t.topic,time:new Date(t.lastUpdate).toLocaleString(),count:t.messages.length,id:t.id,index:n,selected:n===a,onClick:()=>{x(m.y$.Chat),i(n)},onDelete:async()=>{(!e.narrow&&!j||await (0,p.i0)(d.ZP.Home.DeleteChat))&&h.deleteSession(n)},narrow:e.narrow,mask:t.mask},t.id)),n.placeholder]})})})}}};
|