1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00
portainer/app/react/components/PaginationControls/PageButton.tsx

30 lines
560 B
TypeScript

import clsx from 'clsx';
import { ReactNode } from 'react';
interface Props {
active?: boolean;
children: ReactNode;
disabled?: boolean;
onPageChange(page: number): void;
page: number | '...';
}
export function PageButton({
children,
page,
disabled,
active,
onPageChange,
}: Props) {
return (
<li className={clsx({ disabled, active })}>
<button
type="button"
onClick={() => typeof page === 'number' && onPageChange(page)}
disabled={disabled}
>
{children}
</button>
</li>
);
}