paperswithcode / assets /AuthorDetailView-C8wRBt2O.js
nielsr's picture
nielsr HF Staff
Sync paperswithcode.co frontend
14aee29 verified
Raw
History Blame Contribute Delete
1.5 kB
import{e as m,j as e,L as g,b as h}from"./index-Dq4RFSP6.js";import{u as d}from"./useQuery-CeQZ3vLa.js";import{S as c}from"./skeleton-sJ8QzNCc.js";import x from"./NotFound-Nf-uetVd.js";import"./useBaseQuery-BPHJ2Zjo.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};