mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
refactor: migrate Preact components to Astro
This commit is contained in:
24
src/components/AmazonBook.astro
Normal file
24
src/components/AmazonBook.astro
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
// Cspell:words astro
|
||||
import Book from './Book.astro';
|
||||
import Link from './Link.astro';
|
||||
|
||||
interface Props {
|
||||
alt?: string;
|
||||
asin: string;
|
||||
class?: string;
|
||||
}
|
||||
|
||||
const { alt = '', asin, class: className, ...props } = Astro.props;
|
||||
|
||||
const amazonImageUrl = `https://images-na.ssl-images-amazon.com/images/P/${asin}.01.LZZZZZZZ.jpg`;
|
||||
---
|
||||
|
||||
<Link
|
||||
href={`http://www.amazon.de/gp/product/${asin}`}
|
||||
class={className}
|
||||
aria-label={alt}
|
||||
{...props}
|
||||
>
|
||||
<Book alt={alt} src={amazonImageUrl} />
|
||||
</Link>
|
||||
Reference in New Issue
Block a user