Hide next/prev button when no pages are availables
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -90,12 +90,16 @@ function LoadAboveButton({
|
|||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
onLoadMore: () => void;
|
onLoadMore: () => void;
|
||||||
}) {
|
}) {
|
||||||
|
if (!hasMore) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={onLoadMore}
|
onClick={onLoadMore}
|
||||||
disabled={isLoading || !hasMore}
|
disabled={isLoading}
|
||||||
className="w-full"
|
className="w-full"
|
||||||
>
|
>
|
||||||
{isLoading ? "Loading..." : "Load above"}
|
{isLoading ? "Loading..." : "Load above"}
|
||||||
@@ -113,6 +117,10 @@ function LoadBelowButton({
|
|||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
onLoadMore: () => void;
|
onLoadMore: () => void;
|
||||||
}) {
|
}) {
|
||||||
|
if (!hasMore) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Button
|
<Button
|
||||||
@@ -170,7 +178,6 @@ function PeopleListContent({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<p className="text-muted-foreground">1 people needs to get onboarded</p>
|
|
||||||
<Button
|
<Button
|
||||||
asChild
|
asChild
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
@@ -143,6 +143,10 @@ function LoadAboveButton({
|
|||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
onLoadMore: () => void;
|
onLoadMore: () => void;
|
||||||
}) {
|
}) {
|
||||||
|
if (!hasMore) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Button
|
<Button
|
||||||
@@ -166,6 +170,10 @@ function LoadBelowButton({
|
|||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
onLoadMore: () => void;
|
onLoadMore: () => void;
|
||||||
}) {
|
}) {
|
||||||
|
if (!hasMore) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user