summaryrefslogtreecommitdiff
path: root/examples/ssr/src/pages/index.astro
blob: 1ce70bc81ea6f7c05280c44e3246137c551ea76c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
import Header from '../components/Header.astro';
import Container from '../components/Container.astro';
import ProductListing from '../components/ProductListing.astro';
import { getProducts } from '../api';
import '../styles/common.css';

const products = await getProducts(Astro.request);
---

<html lang="en">
	<head>
		<title>Online Store</title>
		<style>
			h1 {
				font-size: 36px;
			}

			.product-listing-title {
				text-align: center;
			}
		</style>
	</head>
	<body>
		<Header />

		<Container tag="main">
			<ProductListing products={products}>
				<h2 class="product-listing-title" slot="title">Product Listing</h2>
			</ProductListing>
		</Container>
	</body>
</html>