MCPcopy Index your code
hub / github.com/coder/coder / PaginationRow

Function PaginationRow

site/src/components/PaginationWidget/PaginationWidgetBase.tsx:92–124  ·  view source on GitHub ↗
({
	currentPage,
	totalPages,
	onChange,
})

Source from the content-addressed store, hash-verified

90};
91
92const PaginationRow: FC<PaginationRowProps> = ({
93 currentPage,
94 totalPages,
95 onChange,
96}) => {
97 const pageInfo = buildPagedList(totalPages, currentPage);
98 const pagesOmitted = totalPages - pageInfo.length - 1;
99
100 return (
101 <>
102 {pageInfo.map((pageEntry) => {
103 if (pageEntry === "left" || pageEntry === "right") {
104 return (
105 <PlaceholderPageButton
106 key={pageEntry}
107 pagesOmitted={pagesOmitted}
108 />
109 );
110 }
111
112 return (
113 <NumberedPageButton
114 key={pageEntry}
115 pageNumber={pageEntry}
116 totalPages={totalPages}
117 highlighted={pageEntry === currentPage}
118 onClick={() => onChange(pageEntry)}
119 />
120 );
121 })}
122 </>
123 );
124};

Callers

nothing calls this directly

Calls 1

buildPagedListFunction · 0.90

Tested by

no test coverage detected