PageSourceSearch

https://delphigrc.org/assets/ScholarLeaderboard-hFyJ5IT_.js

js delphigrc.org collected 2026-09-25 20:48:32 UTC 8,006 bytes, 1 lines download raw bytes

1import{r as e,j as s,L as a}from"./vendor-react-BH6F5oQJ.js";import{s as r,H as t,G as l,f as i,S as o,C as n,m as d,n as c,o as x,q as m,B as h}from"./index-C_oSc_qP.js";import{a as u}from"./vendor-query-CC4VRGyP.js";import{r as j,s as f,n as p,B as g,E as v}from"./vendor-icons-CaI5__By.js";import"./vendor-ui-B4WC06Sp.js";import"./vendor-supabase-COwyE4EW.js";const N=()=>{const[N,b]=e.useState(""),[_,y]=e.useState("citations"),{data:w,isLoading:k}=u({queryKey:["scholar-leaderboard"],queryFn:async()=>{const[e,s]=await Promise.all([r.from("authors_public").select("id, name, role, avatar_url, scholar_h_index, scholar_i10_index, scholar_citations, scholar_profile_url, scholar_last_synced").not("scholar_id","is",null),r.from("fellows_public").select("id, slug, name, title, avatar_url, expertise, scholar_h_index, scholar_i10_index, scholar_citations, scholar_profile_url, scholar_last_synced").not("scholar_id","is",null).eq("is_active",!0)]);return[...(e.data||[]).map(e=>({...e,type:"author"})),...(s.data||[]).map(e=>({...e,type:"fellow"}))]},staleTime:3e5}),C=e.useMemo(()=>{if(!w)return[];let e=w;if(N){const s=N.toLowerCase();e=e.filter(e=>{var a,r;return e.name.toLowerCase().includes(s)||(null==(a=e.title)?void 0:a.toLowerCase().includes(s))||(null==(r=e.role)?void 0:r.toLowerCase().includes(s))})}return e.sort((e,s)=>{const a=e[`scholar_${_}`]||0;return(s[`scholar_${_}`]||0)-a}),e},[w,N,_]),S=e=>0===e?s.jsx(j,{className:"h-5 w-5 text-yellow-500"}):1===e?s.jsx(j,{className:"h-5 w-5 text-gray-400"}):2===e?s.jsx(j,{className:"h-5 w-5 text-amber-600"}):null;return s.jsxs(s.Fragment,{children:[s.jsxs(t,{children:[s.jsx("title",{children:"Scholar Leaderboard - Research Impact Rankings"}),s.jsx("meta",{name:"description",content:"View our researchers ranked by Google Scholar metrics including citations, h-index, and publication impact."})]}),s.jsx("div",{className:"min-h-screen flex flex-col bg-background",children:s.jsxs("main",{className:"flex-1",children:[s.jsx("section",{className:"bg-gradient-to-br from-primary/5 via-primary/10 to-background border-b border-border py-16",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 mb-4",children:[s.jsx(j,{className:"h-8 w-8 text-primary"}),s.jsx("h1",{className:"font-heading text-4xl md:text-5xl font-bold text-foreground",children:"Scholar Leaderboard"})]}),s.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:"Discover our top researchers ranked by Google Scholar metrics, showcasing their impact and contributions to global research."}),s.jsxs("div",{className:"relative max-w-xl mx-auto",children:[s.jsx(f,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),s.jsx(l,{type:"text",placeholder:"Search by name, title, or role...",value:N,onChange:e=>b(e.target.value),className:"pl-10 h-12 bg-background border-border"})]})]})})}),s.jsx("section",{className:"border-b border-border bg-muted/30",children:s.jsx("div",{className:"container mx-auto px-4 py-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Sort by:"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(i,{variant:"citations"===_?"default":"outline",size:"sm",onClick:()=>y("citations"),children:[s.jsx(p,{className:"h-4 w-4 mr-1"}),"Citations"]}),s.jsxs(i,{variant:"h_index"===_?"default":"outline",size:"sm",onClick:()=>y("h_index"),children:[s.jsx(j,{className:"h-4 w-4 mr-1"}),"h-index"]}),s.jsxs(i,{variant:"i10_index"===_?"default":"outline",size:"sm",onClick:()=>y("i10_index"),children:[s.jsx(g,{className:"h-4 w-4 mr-1"}),"i10-index"]})]})]})})}),s.jsx("section",{className:"py-12",children:s.jsxs("div",{className:"container mx-auto px-4",children:[k?s.jsx("div",{className:"space-y-4",children:[...Array(5)].map((e,a)=>s.jsx(o,{className:"h-32"},a))}):0===C.length?s.jsxs("div",{className:"text-center py-16",children:[s.jsx(j,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No Results Found"}),s.jsx("p",{className:"text-muted-foreground",children:N?"Try adjusting your search query":"No scholars with Google Scholar profiles found"})]}):s.jsx("div",{className:"space-y-4 max-w-5xl mx-auto",children:C.map((e,r)=>{var t,l;return s.jsx(n,{className:"hover:shadow-lg transition-shadow",children:s.jsx(d,{className:"p-6",children:s.jsxs("div",{className:"flex flex-col sm:flex-row gap-6 items-start sm:items-center",children:[s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-3",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-muted flex items-center justify-center font-bold text-lg text-foreground",children:r+1}),S(r)]}),s.jsxs(c,{className:"h-16 w-16 border-2 border-border",children:[s.jsx(x,{src:e.avatar_url||void 0,alt:e.name}),s.jsx(m,{className:"text-lg font-semibold",children:(l=e.name,l.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[s.jsxs("div",{children:[s.jsx(a,{to:"fellow"===e.type?`/fellows/${e.slug}`:`/authors/${e.id}`,className:"font-semibold text-lg text-foreground hover:text-primary transition-colors",children:e.name}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"fellow"===e.type?e.title:e.role})]}),s.jsx(h,{variant:"outline",className:"flex-shrink-0",children:"fellow"===e.type?"Fellow":"Author"})]}),s.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-6 mt-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold text-primary",children:(null==(t=e.scholar_citations)?void 0:t.toLocaleStr
1ing())||0}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Citations"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.scholar_h_index||0}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"h-index"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.scholar_i10_index||0}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"i10-index"})]})]}),e.expertise&&e.expertise.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mt-3",children:e.expertise.slice(0,3).map((e,a)=>s.jsx(h,{variant:"secondary",className:"text-xs",children:e},a))})]}),e.scholar_profile_url&&s.jsx("a",{href:e.scholar_profile_url,target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0 text-primary hover:text-primary/80 transition-colors",children:s.jsx(v,{className:"h-5 w-5"})})]})})},e.id)})}),!k&&C.length>0&&s.jsx("div",{className:"mt-12 max-w-5xl mx-auto",children:s.jsx(n,{className:"bg-muted/30",children:s.jsx(d,{className:"p-6",children:s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6 text-center",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:C.length}),s.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Total Scholars"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:C.reduce((e,s)=>e+(s.scholar_citations||0),0).toLocaleString()}),s.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Total Citations"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:Math.round(C.reduce((e,s)=>e+(s.scholar_h_index||0),0)/C.length)}),s.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Avg h-index"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-primary",children:Math.round(C.reduce((e,s)=>e+(s.scholar_i10_index||0),0)/C.length)}),s.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Avg i10-index"})]})]})})})})]})})]})})]})};export{N 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.