Hide next/prev button when no pages are availables

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-13 07:24:44 +01:00
parent e12ca7406c
commit 3fc73adabd
2 changed files with 17 additions and 2 deletions

View File

@@ -90,12 +90,16 @@ function LoadAboveButton({
hasMore: boolean;
onLoadMore: () => void;
}) {
if (!hasMore) {
return null;
}
return (
<div className="flex justify-center">
<Button
variant="outline"
onClick={onLoadMore}
disabled={isLoading || !hasMore}
disabled={isLoading}
className="w-full"
>
{isLoading ? "Loading..." : "Load above"}
@@ -113,6 +117,10 @@ function LoadBelowButton({
hasMore: boolean;
onLoadMore: () => void;
}) {
if (!hasMore) {
return null;
}
return (
<div className="flex justify-center">
<Button
@@ -170,7 +178,6 @@ function PeopleListContent({
</div>
<div className="flex items-center justify-between">
<p className="text-muted-foreground">1 people needs to get onboarded</p>
<Button
asChild
variant="outline"

View File

@@ -143,6 +143,10 @@ function LoadAboveButton({
hasMore: boolean;
onLoadMore: () => void;
}) {
if (!hasMore) {
return null;
}
return (
<div className="flex justify-center">
<Button
@@ -166,6 +170,10 @@ function LoadBelowButton({
hasMore: boolean;
onLoadMore: () => void;
}) {
if (!hasMore) {
return null;
}
return (
<div className="flex justify-center">
<Button