aboutsummaryrefslogtreecommitdiff
path: root/src/components/Pagination.astro
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-09-13 01:10:31 +0300
committerValentin Popov <valentin@popov.link>2024-09-13 01:10:31 +0300
commitde1885fe8fe279c95c2c2b101fad916958dadd4a (patch)
tree11925fe753743b85a0c37333848ab4322665468e /src/components/Pagination.astro
parent3591bebabff902106632f0f0b309f3baa1e04a17 (diff)
downloadpopov.link-de1885fe8fe279c95c2c2b101fad916958dadd4a.tar.xz
popov.link-de1885fe8fe279c95c2c2b101fad916958dadd4a.zip
Added Pagination component
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>