Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/dashboard/src/Pagination/PaginationNavigationButton.tsx
2500 views
1
/**
2
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
* Licensed under the GNU Affero General Public License (AGPL).
4
* See License.AGPL.txt in the project root for license information.
5
*/
6
7
import Arrow from "../components/Arrow";
8
9
interface PaginationNavigationButtonProps {
10
isDisabled: boolean;
11
label: string;
12
arrowDirection: string;
13
onClick: () => void;
14
}
15
16
function PaginationNavigationButton(props: PaginationNavigationButtonProps) {
17
const activeArrowClass = props.isDisabled
18
? "border-gray-300 dark:border-gray-500"
19
: "border-gray-500 dark:border-gray-400 group-hover:border-gray-600 dark:group-hover:border-gray-400";
20
21
return (
22
<li
23
className={`font-semibold text-gray-300 ${
24
props.isDisabled ? "disabled dark:text-gray-500" : "cursor-pointer dark:text-gray-400 text-gray-500"
25
}`}
26
>
27
<span onClick={props.onClick}>
28
{props.arrowDirection === "right" && props.label}
29
<Arrow direction={props.arrowDirection} customBorderClasses={activeArrowClass} />
30
{props.arrowDirection === "left" && props.label}
31
</span>
32
</li>
33
);
34
}
35
36
export default PaginationNavigationButton;
37
38