PageSourceSearch

https://cridergpt.com/assets/UpdatesPanel-CmHQIu85.js

js cridergpt.com collected 2026-10-02 01:26:40 UTC 3,928 bytes, 1 lines download raw bytes

1import{u as j,r as n,s as l,j as e,L as g,C as o,e as u,A as i,b as y,c as b,l as N,d as _,m as w,F as v,n as U,U as C,o as A,K as q}from"./index-0skl7k4W.js";import{M as S}from"./mic-DAhiJtu1.js";import{f as T}from"./format-C7un5U2x.js";const k=t=>{switch(t){case"api_key_added":return e.jsx(q,{className:"w-4 h-4"});case"tts_request":return e.jsx(S,{className:"w-4 h-4"});case"ai_request":return e.jsx(A,{className:"w-4 h-4"});case"file_upload":return e.jsx(C,{className:"w-4 h-4"});case"project_created":return e.jsx(U,{className:"w-4 h-4"});case"feature_unlocked":return e.jsx(i,{className:"w-4 h-4"});default:return e.jsx(v,{className:"w-4 h-4"})}},E=t=>{switch(t){case"api_key_added":return"bg-blue-500/10 text-blue-700 border-blue-200";case"tts_request":return"bg-purple-500/10 text-purple-700 border-purple-200";case"ai_request":return"bg-green-500/10 text-green-700 border-green-200";case"file_upload":return"bg-orange-500/10 text-orange-700 border-orange-200";case"project_created":return"bg-cyan-500/10 text-cyan-700 border-cyan-200";case"feature_unlocked":return"bg-yellow-500/10 text-yellow-700 border-yellow-200";default:return"bg-gray-500/10 text-gray-700 border-gray-200"}};function L(){const{user:t}=j(),[c,d]=n.useState([]),[m,x]=n.useState(!0);n.useEffect(()=>{if(!t)return;h();const s=l.channel("user-updates-changes").on("postgres_changes",{event:"INSERT",schema:"public",table:"user_updates",filter:`user_id=eq.${t.id}`},a=>{const r=a.new;r.user_id===t.id&&d(f=>[r,...f])}).subscribe();return()=>{l.removeChannel(s)}},[t]);const h=async()=>{if(t)try{const{data:s,error:a}=await l.from("user_updates").select("*").eq("user_id",t.id).order("created_at",{ascending:!1}).limit(100);if(a)throw a;d(s||[])}catch(s){console.error("Error fetching updates:",s)}finally{x(!1)}},p=s=>s.split("_").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ");return m?e.jsx("div",{className:"flex items-center justify-center h-48",children:e.jsx(g,{className:"w-6 h-6 animate-spin"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Activity Updates"}),e.jsx("p",{className:"text-muted-foreground",children:"Track all your recent activities and changes"})]}),c.length===0?e.jsx(o,{children:e.jsxs(u,{className:"py-12 text-center",children:[e.jsx(i,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"No updates yet"}),e.jsx("p",{className:"text-muted-foreground",children:"Your activity updates will appear here as you use the system"})]})}):e.jsxs(o,{children:[e.jsx(y,{children:e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(i,{className:"w-5 h-5"}),"Recent Activity (",c.length,")"]})}),e.jsx(u,{children:e.jsx(N,{className:"h-[500px]",children:e.jsx("div",{className:"space-y-4",children:c.map(s=>e.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("div",{className:"mt-1",children:k(s.update_type)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-medium text-sm",children:s.title}),e.jsx(_,{variant:"outline",className:`text-xs ${E(s.update_type)}`,children:p(s.update_type)})]}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:s.description}),s.metadata&&e.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:Object.entries(s.metadata).map(([a,r])=>e.jsxs("span",{className:"inline-block mr-4",children:[e.jsxs("strong",{children:[a,":"]})," ",String(r)]},a))}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{children:w(new Date(s.created_at),{addSuffix:!0})}),e.jsx("span",{children:T(new Date(s.created_at),"MMM d, yyyy HH:mm")})]})]})]},s.id))})})})]})]})}export{L as UpdatesPanel};

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.