Link coaches to their chesscom/lichess page.

main
Joshua Potter 2023-12-05 16:14:35 -07:00
parent 54c7d14669
commit 2a4d969030
2 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@ type SearchResultProps = {
title?: string
subtitle?: string
src?: string
} & React.ComponentPropsWithoutRef<"div">
} & React.ComponentPropsWithoutRef<"a">
export function SearchResult({
title,
@ -15,7 +15,7 @@ export function SearchResult({
...props
}: SearchResultProps) {
return (
<div
<a
className={clsx(
"group relative h-96 overflow-hidden rounded-3xl bg-neutral-100",
className
@ -36,6 +36,6 @@ export function SearchResult({
<p className="mt-2 text-sm text-white">{subtitle}</p>
) : null}
</div>
</div>
</a>
)
}

View File

@ -38,6 +38,14 @@ function SearchResults() {
src={coach.image_url ?? ""}
title={coach.name ?? ""}
subtitle={coach.name ?? ""}
target="_blank"
href={
coach.site === "lichess"
? `https://lichess.org/coach/${coach.username}`
: coach.site === "chesscom"
? `https://www.chess.com/member/${coach.username}`
: undefined
}
/>
</FadeIn>
))}