popov.link/src/components/Pagination.astro

47 lines
546 B
Plaintext
Raw Normal View History

2024-09-12 22:10:31 +00:00
---
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>