@equinor/eds-core-react
Version:
The React implementation of the Equinor Design System
31 lines (28 loc) • 676 B
JavaScript
import { forwardRef } from 'react';
import { Button } from '../Button/index.js';
import { pagination } from './Pagination.tokens.js';
import { jsx } from 'react/jsx-runtime';
const PaginationItem = /*#__PURE__*/forwardRef(function PaginationItem({
$page,
selected,
onClick,
...rest
}, ref) {
const props = {
ref,
$page,
selected,
...rest
};
const background = selected ? pagination.entities.item.states.active.background : null;
return /*#__PURE__*/jsx(Button, {
style: {
background
},
variant: "ghost_icon",
onClick: onClick ? onClick : undefined,
...props,
children: $page
});
});
export { PaginationItem };