import clsx from 'clsx' import { User } from '../../common/user' import { Avatar } from './avatar' import { Row } from './layout/row' import { SiteLink } from './site-link' import { Title } from './title' export function Leaderboard(props: { title: string users: User[] columns: { header: string renderCell: (user: User) => any }[] className?: string }) { // TODO: Ideally, highlight your own entry on the leaderboard const { title, users, columns, className } = props return (
# | Name | {columns.map((column) => ({column.header} | ))}
---|---|---|
{index + 1} |
{user.name}
|
{columns.map((column) => (
{column.renderCell(user)} | ))}