package.src.components.Pagination.ToggleTemplate.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react-core Show documentation
Show all versions of react-core Show documentation
This library provides a set of common React components for use with the PatternFly reference implementation.
The newest version!
import * as React from 'react';
/** Allows more customization of the pagination dropdown toggle. The following properties
* should be passed into the pagination component's toggleTemplate property.
*/
export interface PaginationToggleTemplateProps {
/** The first index of the items being paginated */
firstIndex?: number;
/** The last index of the items being paginated */
lastIndex?: number;
/** The total number of items being paginated */
itemCount?: number;
/** The type or title of the items being paginated */
itemsTitle?: string;
/** The word that joins the index and itemCount/itemsTitle */
ofWord?: React.ReactNode;
}
export const ToggleTemplate: React.FunctionComponent = ({
firstIndex = 0,
lastIndex = 0,
itemCount = 0,
itemsTitle = 'items',
ofWord = 'of'
}: PaginationToggleTemplateProps) => (
{firstIndex} - {lastIndex}
{' '}
{ofWord} {itemCount} {itemsTitle}
);
ToggleTemplate.displayName = 'ToggleTemplate';