import React from "react"; import { StyledButton } from "./paginationHelpers"; import type { Button } from "../button"; import type * as WPDS from "../theme"; const NAME = "PaginationPageButton"; export type PaginationPageButtonProps = { /** Function to change current page */ changePage: React.Dispatch>; /** Override CSS */ css?: WPDS.CSS; /** The current page */ currentPage: number; /** Page number */ num: number; /** Current page slug */ slug: string; } & React.ComponentPropsWithRef & React.ComponentProps; export const PaginationPageButton = ({ changePage, css, currentPage, num, slug, disabled, hidden, icon, children = num, }: PaginationPageButtonProps) => { const selected = currentPage === num; const href = !slug?.length ? null : `${slug}?page=${num}`; return ( ); }; PaginationPageButton.displayName = NAME;