From 6c2eea4bf89f883c168008db8d6520e4d40dcb74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Tue, 27 Feb 2024 10:53:44 +0000 Subject: [PATCH] fix: disable if not used --- components/paginations/paginations.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/paginations/paginations.go b/components/paginations/paginations.go index bf48c67..63b9540 100644 --- a/components/paginations/paginations.go +++ b/components/paginations/paginations.go @@ -35,6 +35,7 @@ func Prev(p PaginationProps) htmx.Node { "join-item": true, "btn": true, "btn-outline": true, + "disabled": p.Offset == 0, }, htmx.HxGet(fmt.Sprintf("%s?offset=%d&limit=%d", p.URL, p.Offset-p.Limit, p.Limit)), htmx.HxSwap("innerHTML"), @@ -51,7 +52,7 @@ func Next(p PaginationProps) htmx.Node { "btn": true, "btn-outline": true, }, - htmx.HxGet(fmt.Sprintf("%s?offset=%d&limit=%d", p.URL, p.Offset-p.Limit, p.Limit)), + htmx.HxGet(fmt.Sprintf("%s?offset=%d&limit=%d", p.URL, p.Offset+p.Limit, p.Limit)), htmx.HxSwap("innerHTML"), htmx.HxTarget("#data-table"), htmx.Text("Next"),