PageSourceSearch

https://app.bdow.com/assets/index-DypC3pn9.js

js bdow.com collected 2026-10-01 09:19:39 UTC 4,355 bytes, 1 lines download raw bytes

1import{c as S,r as w,j as e,Z as x,_ as R}from"./main-DXUUxPtv.js";import{u as C}from"./useQuery-zZoPXqWY.js";import{f as k,C as T,a as L}from"./name-YYcrqtUJ.js";import{B as q}from"./badge-Dj6Gl-fY.js";import{B as z}from"./button-BqZFYA_-.js";import{I as M}from"./input-Bqvgo2LQ.js";import{T as h,a as p,b as m,c as d,d as f,e as u}from"./table-LYsPG2nu.js";import{c as B}from"./utils-BQHNewu7.js";import{S as j}from"./search-EIOTdb1p.js";import{G as E}from"./globe-B_sGRelq.js";import"./card-DW0YF51c.js";import"./collapsible-CNNs51oU.js";import"./index-sZPec7rF.js";import"./chevron-down-Bg08ja13.js";import"./index-LHNt3CwB.js";import"./label-Bjxa1Wtm.js";const U=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],A=S("users",U),N=R("/_auth/admin/");function y({icon:a,title:l,count:i,hasMore:n,emptyLabel:t,children:r}){const c=i===0;return e.jsxs(T,{icon:a,title:l,accessory:e.jsxs(q,{variant:"neutral",children:[i,n?"+":""]}),contentClassName:"p-0",children:[c?e.jsx("p",{className:"px-6 py-10 text-center text-sm text-muted-foreground",children:t}):r,n?e.jsx("p",{className:"border-t px-6 py-3 text-xs text-muted-foreground",children:"Showing the first results — refine your search to narrow it down."}):null]})}function I(){const{q:a}=N.useSearch(),l=N.useNavigate(),[i,n]=w.useState(a),{data:t,isFetching:r,isError:c}=C({queryKey:["adminSearch",a],queryFn:()=>L({data:{query:a}}),enabled:!!a}),g=s=>{s.preventDefault();const o=i.trim();o&&l({search:{q:o}})},b=s=>l({to:"/admin/user/$id",params:{id:s},search:{q:a}}),v=s=>l({to:"/admin/site/$id",params:{id:s},search:{q:a}});return e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-6 p-6",children:[e.jsxs("header",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Admin search"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Look up any user or site by email, name, site id, or URL."})]}),e.jsxs("form",{onSubmit:g,className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(j,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(M,{value:i,onChange:s=>n(s.target.value),placeholder:"Search by email, name, site id, or URL",className:"pl-9"})]}),e.jsx(z,{type:"submit",disabled:r||!i.trim(),children:r?e.jsx(x,{className:"size-4 animate-spin"}):"Search"})]}),c&&!t?e.jsx("p",{className:"py-16 text-center text-sm text-muted-foreground",children:"Something went wrong running the search. Try again."}):null,!t&&!r&&!c?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center text-muted-foreground",children:[e.jsx(j,{className:"size-8"}),e.jsx("p",{className:"text-sm",children:"Search for a user or site to get started."})]}):null,r&&!t?e.jsx("div",{className:"flex items-center justify-center py-16 text-muted-foreground",children:e.jsx(x,{className:"size-6 animate-spin"})}):null,t?e.jsxs("div",{className:B("flex flex-col gap-6",r&&"opacity-60"),children:[e.jsx(y,{icon:e.jsx(A,{className:"size-4"}),title:"Users",count:t.userResults.results.length,hasMore:t.userResults.hasMore,emptyLabel:"No users match your search.",children:e.jsxs(h,{children:[e.jsx(p,{children:e.jsxs(m,{children:[e.jsx(d,{children:"Email"}),e.jsx(d,{children:"Name"})]})}),e.jsx(f,{children:t.userResults.results.map(s=>e.jsxs(m,{className:"cursor-pointer",onClick:()=>b(s.id),children:[e.jsx(u,{className:"font-medium",children:s.email}),e.jsx(u,{children:k(s.firstName,s.lastName)})]},s.id))})]})}),e.jsx(y,{icon:e.jsx(E,{className:"size-4"}),title:"Sites",count:t.siteResults.results.length,hasMore:t.siteResults.hasMore,emptyLabel:"No sites match your search.",children:e.jsxs(h,{children:[e.jsx(p,{children:e.jsxs(m,{children:[e.jsx(d,{children:"Site"}),e.jsx(d,{children:"Owner"})]})}),e.jsx(f,{children:t.siteResults.results.map(({site:s,owner:o})=>e.jsxs(m,{className:"cursor-pointer",onClick:()=>v(s.id),children:[e.jsx(u,{className:"font-medium",children:s.href??s.id}),e.jsx(u,{children:o?.email??"—"})]},s.id))})]})})]}):null]})})}const ee=I;export{ee 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.