1import{z as b,D as F,E as I,Q as L,e as N,r as l,f,j as e,B as r,I as _,N as y,C as x,d as u,L as v,a as q,b as D,k as i,am as z,an as T,ao as A,ap as B}from"./index-DHwBXtP2.js";import{g as E}from"./transcripts.functions-BDLFyQF7.js";import{U as O}from"./users-Cd2QSwK4.js";import{F as R}from"./file-text-CzX-qSj6.js";import{L as Q}from"./link-2-CcwU8aas.js";const $=b({method:"POST"}).middleware([F]).handler(I("src_lib_my-meetings_functions_ts--getMyMeetings_createServerFn_handler"));function H(a){return a?new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"No date"}function W(){const a=L(),w=N($),C=N(E),[n,p]=l.useState("mine"),[o,S]=l.useState("all"),[d,k]=l.useState(""),[c,g]=l.useState(null),s=f({queryKey:["my-meetings",a,n,o,d],enabled:!!a,queryFn:()=>w({data:{workspaceId:a,scope:n,filter:o,q:d||void 0,limit:100}})}),m=f({queryKey:["my-meeting-detail",a,c],enabled:!!a&&!!c,queryFn:()=>C({data:{workspaceId:a,transcriptId:c}})}),j=s.data?.rows??[],h=s.data?.counts??{total:0,attached:0,unattached:0};return e.jsxs("div",{className:"space-y-6 p-4 md:p-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"My meeting notes"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Every meeting Brain synced for you â with the notes â whether or not it was matched to a client account."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1 rounded-lg border p-1",children:[e.jsx(r,{size:"sm",variant:n==="mine"?"secondary":"ghost",onClick:()=>p("mine"),children:"Mine"}),s.data?.canSeeTeam&&e.jsxs(r,{size:"sm",variant:n==="team"?"secondary":"ghost",onClick:()=>p("team"),children:[e.jsx(O,{className:"mr-1.5 h-3.5 w-3.5"}),"My team"]})]}),e.jsx("div",{className:"flex gap-1 rounded-lg border p-1",children:[["all",`All (${h.total})`],["attached",`On a client (${h.attached})`],["unattached",`Not attached (${h.unattached})`]].map(([t,M])=>e.jsx(r,{size:"sm",variant:o===t?"secondary":"ghost",onClick:()=>S(t),children:M},t))}),e.jsx(_,{value:d,onChange:t=>k(t.target.value),placeholder:"Search title, client or notesâ¦",className:"h-9 w-64"})]}),s.isLoading&&e.jsx("div",{className:"space-y-2",children:[0,1,2,3].map(t=>e.jsx(y,{className:"h-20 w-full"},t))}),s.isError&&e.jsx(x,{children:e.jsx(u,{className:"p-4 text-sm text-destructive",children:"Could not load your meetings. Refresh the page and try again."})}),!s.isLoading&&j.length===0&&e.jsx(x,{children:e.jsxs(u,{className:"space-y-1 p-6 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-medium text-foreground",children:"No meeting notes here yet."}),e.jsxs("p",{children:["Brain reads notes from your connected calendar and Meet/Gemini notes. If you expect meetings here, check your"," ",e.jsx(v,{className:"underline",to:"/settings/calendar",children:"calendar connection"}),"."]})]})}),e.jsx("div",{className:"space-y-2",children:j.map(t=>e.jsxs(x,{children:[e.jsx(q,{className:"pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsx(D,{className:"text-base",children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(i,{variant:"outline",className:"text-[10px]",children:H(t.startedAt)}),t.attached?e.jsx(i,{variant:"secondary",className:"text-[10px]",children:t.contactName??t.contactCompany??"On a client"}):e.jsx(i,{variant:"outline",className:"text-[10px]",children:"Not attached"}),t.thin&&e.jsx(i,{variant:"outline",className:"text-[10px]",children:"Very short"}),n==="team"&&!t.ownerIsMe&&t.ownerName&&e.jsx(i,{variant:"outline",className:"text-[10px]",children:t.ownerName})]})]})}),e.jsxs(u,{className:"space-y-2",children:[e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.excerpt||"No notes captured for this meeting."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(r,{size:"sm",variant:"outline",onClick:()=>g(t.id),children:[e.jsx(R,{className:"mr-1.5 h-3.5 w-3.5"}),"Read notes"]}),!t.attached&&e.jsx(r,{asChild:!0,size:"sm",variant:"ghost",children:e.jsxs(v,{to:"/transcripts/unmatched",children:[e.jsx(Q,{className:"mr-1.5 h-3.5 w-3.5"}),"Attach to a client"]})})]})]})]},t.id))}),e.jsx(z,{open:!!c,onOpenChange:t=>!t&&g(null),children:e.jsxs(T,{className:"max-h-[85vh] max-w-3xl overflow-y-auto",children:[e.jsx(A,{children:e.jsx(B,{children:m.data?.meeting_title??"Meeting notes"})}),m.isLoading?e.jsx(y,{className:"h-64 w-full"}):e.jsx("pre",{className:"whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground",children:m.data?.text_content||"No notes were captured for this meeting."})]})})]})}export{W as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.