MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / EntityPagination

Function EntityPagination

src/components/entity-components.tsx:141–172  ·  view source on GitHub ↗
({
  page,
  totalPages,
  onPageChange,
  disabled,
}: EntityPaginationProps)

Source from the content-addressed store, hash-verified

139};
140
141export const EntityPagination = ({
142 page,
143 totalPages,
144 onPageChange,
145 disabled,
146}: EntityPaginationProps) => {
147 return (
148 <div className="flex items-center justify-between gap-x-2 w-full">
149 <div className="flex-1 text-sm text-muted-foreground">
150 Page {page} of {totalPages || 1}
151 </div>
152 <div className="flex items-center justify-end space-x-2 py-4">
153 <Button
154 disabled={page === 1 || disabled}
155 variant="outline"
156 size="sm"
157 onClick={() => onPageChange(Math.max(1, page - 1))}
158 >
159 Previous
160 </Button>
161 <Button
162 disabled={page === totalPages || totalPages === 0 || disabled}
163 variant="outline"
164 size="sm"
165 onClick={() => onPageChange(Math.min(totalPages, page + 1))}
166 >
167 Next
168 </Button>
169 </div>
170 </div>
171 )
172};
173
174interface StateViewProps {
175 message?: string;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected