Files
tuono/examples/tutorial/src/components/PokemonLink.tsx
T
2024-11-13 08:33:48 +01:00

30 lines
538 B
TypeScript

import type { JSX } from 'react'
import { Link } from 'tuono'
import styles from './PokemonLink.module.css'
interface Pokemon {
name: string
}
export default function PokemonLink({
pokemon,
id,
}: {
pokemon: Pokemon
id: number
}): JSX.Element {
return (
<Link
className={styles.link}
href={`/pokemons/${pokemon.name}`}
id={pokemon.name}
>
{pokemon.name}
<img
src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${id}.png`}
/>
</Link>
)
}