aboutsummaryrefslogtreecommitdiff
path: root/src/components/Pagination.astro
blob: e9fbc69011b824569c5b6d4b7461e40bfc088b3a (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
34
35
36
37
38
39
40
41
42
43
44
45
46
---
type Props = {
	readonly prevUrl?: string;
	readonly nextUrl?: string;
};

const { prevUrl, nextUrl } = Astro.props;
---

<style lang="scss">
	.pagination {
		overflow: hidden;
		padding: 3rem 0;
		width: 100%;
	}

	.prev,
	.next {
		max-width: 40%;
	}

	.prev {
		float: left;
	}

	.next {
		float: right;
	}
</style>

<div class="pagination">
	{
		prevUrl && (
			<span class="prev">
				<a href={prevUrl}>&lt; Prev</a>
			</span>
		)
	}
	{
		nextUrl && (
			<span class="next">
				<a href={nextUrl}>Next &gt;</a>
			</span>
		)
	}
</div>