PageSourceSearch

https://edgemxtiming.com/assets/IdentitySyncPage-7voHyOmf.js

js edgemxtiming.com collected 2026-10-02 01:28:58 UTC 3,207 bytes, 1 lines download raw bytes

1import{r as y,l,j as e,B as p,m as b,o as w,p as N,q as v,n as C,I as R,d as S,v as z,s as m}from"./index-Ct8eLu1I.js";import{T,a as q,b as x,c as t,d as B,e as r}from"./table--nl4fhep.js";import{R as L}from"./refresh-cw-B5_EXY-e.js";const $="timing_lab_riders(cross_org_sync)";function F(){const[n,h]=y.useState(""),{data:i=[],isLoading:f,isFetching:o,refetch:_}=l({queryKey:["identity-sync-log"],queryFn:async()=>{const{data:a,error:s}=await m.from("lab_rider_identity_propagation_log").select("id, rider_id, organization_id, target_table, before_first_name, before_last_name, after_first_name, after_last_name, created_at").eq("target_table",$).order("created_at",{ascending:!1}).limit(300);if(s)throw s;return a??[]}}),{data:u=[]}=l({queryKey:["identity-sync-orgs"],queryFn:async()=>{const{data:a,error:s}=await m.from("organizations").select("id, name").limit(500);if(s)throw s;return a??[]}}),j=a=>{var s;return((s=u.find(g=>g.id===a))==null?void 0:s.name)??"—"},d=n.trim().toLowerCase(),c=d?i.filter(a=>`${a.before_first_name??""} ${a.before_last_name??""} ${a.after_first_name??""} ${a.after_last_name??""}`.toLowerCase().includes(d)):i;return e.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Identity Sync"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Rider name corrections that were automatically copied to every organization."})]}),e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>_(),disabled:o,children:[e.jsx(L,{className:`h-4 w-4 mr-2 ${o?"animate-spin":""}`}),"Refresh"]})]}),e.jsxs(b,{children:[e.jsxs(w,{children:[e.jsx(N,{className:"text-base",children:"Recent cross-organization updates"}),e.jsx(v,{children:"Runs automatically whenever a rider's name or birth date is saved anywhere — signup, kiosk, Race Day or the rider editor."})]}),e.jsxs(C,{className:"space-y-4",children:[e.jsx(R,{placeholder:"Search by rider name…",value:n,onChange:a=>h(a.target.value),className:"max-w-sm"}),f?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-8",children:[e.jsx(S,{className:"h-4 w-4 animate-spin"})," Loading…"]}):c.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-8",children:"No cross-organization updates recorded yet."}):e.jsx("div",{className:"rounded-md border overflow-x-auto",children:e.jsxs(T,{children:[e.jsx(q,{children:e.jsxs(x,{children:[e.jsx(t,{children:"When"}),e.jsx(t,{children:"Was"}),e.jsx(t,{children:"Now"}),e.jsx(t,{children:"Organization"})]})}),e.jsx(B,{children:c.map(a=>e.jsxs(x,{children:[e.jsx(r,{className:"whitespace-nowrap text-sm text-muted-foreground",children:new Date(a.created_at).toLocaleString("en-US",{timeZone:"America/Denver"})}),e.jsx(r,{className:"text-sm",children:[a.before_first_name,a.before_last_name].filter(Boolean).join(" ")||"—"}),e.jsx(r,{className:"text-sm font-medium",children:[a.after_first_name,a.after_last_name].filter(Boolean).join(" ")||"—"}),e.jsx(r,{children:e.jsx(z,{variant:"secondary",children:j(a.organization_id)})})]},a.id))})]})})]})]})]})}export{F as default};

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.