mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-04 08:30:27 +03:00
Added Pagination component
This commit is contained in:
46
src/components/Pagination.astro
Normal file
46
src/components/Pagination.astro
Normal file
@ -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}>< Prev</a>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
{
|
||||
nextUrl && (
|
||||
<span class="next">
|
||||
<a href={nextUrl}>Next ></a>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
</div>
|
Reference in New Issue
Block a user