aboutsummaryrefslogtreecommitdiff
path: root/src/components/Pagination.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Pagination.astro')
-rw-r--r--src/components/Pagination.astro46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/components/Pagination.astro b/src/components/Pagination.astro
new file mode 100644
index 0000000..e9fbc69
--- /dev/null
+++ b/src/components/Pagination.astro
@@ -0,0 +1,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>