1import{h as u,ao as f,s as x,j as e,C as p,c as h,d as _,b as g,aI as v,aJ as b,aK as j,ar as N}from"./index-LTiB72C6.js";import{H as w}from"./heart-DPiNftlu.js";const D=()=>{const{company:a,demoMode:i}=u(),m=[{id:"demo-1",from_profile:{full_name:"Sarah Chen",avatar_url:"https://api.dicebear.com/7.x/avataaars/svg?seed=sarah"},to_profile:{full_name:"Marcus Johnson",avatar_url:"https://api.dicebear.com/7.x/avataaars/svg?seed=marcus"},message:"ð Amazing work on the Q2 presentation! Your insights really helped the team.",created_at:new Date(Date.now()-2*60*60*1e3).toISOString()},{id:"demo-2",from_profile:{full_name:"Alex Thompson",avatar_url:"https://api.dicebear.com/7.x/avataaars/svg?seed=alex"},to_profile:{full_name:"Emily Rodriguez",avatar_url:"https://api.dicebear.com/7.x/avataaars/svg?seed=emily"},message:"â Thank you for mentoring the new team members! Your patience and expertise are invaluable.",created_at:new Date(Date.now()-5*60*60*1e3).toISOString()},{id:"demo-3",from_profile:{full_name:"David Park",avatar_url:"https://api.dicebear.com/7.x/avataaars/svg?seed=david"},to_profile:{full_name:"Lisa Martinez",avatar_url:"https://api.dicebear.com/7.x/avataaars/svg?seed=lisa"},message:"ð¡ Great problem-solving on the integration issue. You saved us hours of work!",created_at:new Date(Date.now()-24*60*60*1e3).toISOString()}],{data:c}=f({queryKey:["recent-kudos",a==null?void 0:a.id],queryFn:async()=>{if(!(a!=null&&a.id))return[];const{data:s,error:r}=await x.from("kudos").select(` 2 *, 3 from_profile:from_user_id ( 4 full_name, 5 avatar_url 6 ), 7 to_profile:to_user_id ( 8 full_name, 9 avatar_url 10 ) 11 `).eq("company_id",a.id).eq("is_public",!0).order("created_at",{ascending:!1}).limit(3);if(r)throw r;return s||[]},enabled:!!(a!=null&&a.id)&&!i}),t=i?m:c;return e.jsxs(p,{children:[e.jsx(h,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-5 w-5 text-primary"}),e.jsx(_,{className:"text-lg",children:"Kudos Corner"})]})}),e.jsx(g,{children:!t||t.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No kudos yet. Be the first to recognize someone!"}):e.jsx("div",{className:"space-y-4",children:t.map(s=>{var r,o,l,d,n;return e.jsxs("div",{className:"flex items-start gap-3 pb-3 border-b last:border-0 last:pb-0",children:[e.jsxs(v,{className:"h-10 w-10",children:[e.jsx(b,{src:(r=s.from_profile)==null?void 0:r.avatar_url}),e.jsx(j,{className:"bg-muted text-muted-foreground",children:((l=(o=s.from_profile)==null?void 0:o.full_name)==null?void 0:l[0])||"?"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium truncate",children:(d=s.from_profile)==null?void 0:d.full_name}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"â"}),e.jsx("span",{className:"text-sm font-medium truncate",children:(n=s.to_profile)==null?void 0:n.full_name})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:s.message}),e.jsx("p",{className:"text-xs text-muted-foreground",children:N(new Date(s.created_at),{addSuffix:!0})})]})]},s.id)})})})]})};export{D as KudosCornerWidget};
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.