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 ~1000px (1104px card content minus language circles area). // Inter 600 average char width is ~0.58× the font size. const maxSize = TYPOGRAPHY.repoName.fontSize; const fitted = Math.floor(1000 / (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} ); }