Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion components/top-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Props = {
export function TopList({ userResults }: Props) {
const cardDetails = (data: {
title: string;
titleHref?: string;
subtitle?: string;
score?: number;
badges: { tooltip?: string; label?: any; icon: any }[];
Expand All @@ -37,7 +38,20 @@ export function TopList({ userResults }: Props) {
key={data.key}
>
<div>
<div className="font-medium text-slate-900">{data.title}</div>
<div className="font-medium text-slate-900">
{data.titleHref ? (
<a
href={data.titleHref}
target="_blank"
rel="noopener noreferrer"
className="hover:underline"
>
{data.title}
</a>
) : (
data.title
)}
</div>
<div className="text-xs text-muted-foreground mt-1">
{data.subtitle}
</div>
Expand Down Expand Up @@ -88,6 +102,9 @@ export function TopList({ userResults }: Props) {
cardDetails({
key: `repo-${i}`,
title: repo.name || "Unknown Repository",
titleHref: repo.name
? `https://github.com/${user.username}/${repo.name}`
: undefined,
score: repo.score,
badges: [
{
Expand Down
Loading