import Link from 'next/link' import { documents, authors, affiliations, Author } from './db/data' import News from './components/News' import RandomDocs from './components/RandomDocs' import RecentDocuments from './components/RecentDocuments' function sortAuthorsByDocumentsPublished(authors: { [key: string]: Author }): { id: string; author: Author }[] { // Initialize a map to count documents for each author const authorDocumentCount: { [key: string]: number } = {} // Iterate over documents to count the number for each author Object.values(documents).forEach((document) => { document.manifest.authors.forEach((authorId) => { if (authorDocumentCount[authorId]) { authorDocumentCount[authorId] += 1 } else { authorDocumentCount[authorId] = 1 } }) }) // Convert the authors object into an array of objects including the author ID const authorsWithId = Object.keys(authors).map((id) => ({ id, author: authors[id], count: authorDocumentCount[id] || 0, // Include the count for sorting })) // Sort authors by their document count in descending order authorsWithId.sort((a, b) => b.count - a.count) // Return the sorted array, excluding the count property return authorsWithId.map(({ id, author }) => ({ id, author })) } export default function Home() { const AuthorDisplay = () => { return (
eeXiv, like arXiv, is a free distribution service and an open-access archive for over {Object.keys(documents).length} scholarly articles in the fields of physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering and systems science, and economics, but mainly related to the{' '} FIRST Robotics Competition (FRC) . Materials on this site may be published independently through other channels. Read more about us here.