import { Card, Row, Col } from "../shared/layout"; import { Avatar } from "../shared/avatar"; import { LanguageCircles } from "../shared/language-circles"; import { Metrics } from "../shared/metrics"; import { TangledLogo } from "../shared/logo"; import { FooterStats } from "../shared/footer-stats"; import { TYPOGRAPHY } from "../shared/constants"; import type { RepositoryCardData } from "../../validation"; function repoNameFontSize(name: string): number { // Available width ~756px // Inter 600 average char width is ~0.58× the font size. const maxSize = TYPOGRAPHY.repoName.fontSize; const fitted = Math.floor(756 / (name.length * 0.58)); return Math.min(maxSize, Math.max(fitted, 48)); } export function RepositoryCard(data: RepositoryCardData) { const fontSize = repoNameFontSize(data.repoName); return (
{data.repoName}
{data.ownerHandle}
); }