mirror of
https://github.com/hansjone/netx.git
synced 2026-10-17 14:33:18 +08:00
Fold NE selection and refresh status into the shared list pager.
Add an optional ListPager meta slot so Managed NE no longer needs a separate selection row above the table. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
312f6f2f96
commit
0ecff329cf
3 changed files with 38 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { Button, Input } from "@heroui/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useState, type ReactNode } from "react";
|
||||
import { useI18n } from "../i18n";
|
||||
import { FieldSelect } from "./ui/FieldSelect";
|
||||
|
||||
|
|
@ -13,6 +13,8 @@ export type ListPagerProps = {
|
|||
onPageSizeChange?: (size: number) => void;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
/** Extra status shown after the totals (e.g. selection count), so pages need no separate row. */
|
||||
meta?: ReactNode;
|
||||
};
|
||||
|
||||
/** Shared denser pager: meta + prev/next + jump + optional page size. */
|
||||
|
|
@ -26,6 +28,7 @@ export function ListPager({
|
|||
onPageSizeChange,
|
||||
disabled = false,
|
||||
className = "",
|
||||
meta,
|
||||
}: ListPagerProps) {
|
||||
const { t } = useI18n();
|
||||
const safePages = Math.max(1, pages || 1);
|
||||
|
|
@ -54,6 +57,7 @@ export function ListPager({
|
|||
page: String(page),
|
||||
pages: String(safePages),
|
||||
})}
|
||||
{meta}
|
||||
</div>
|
||||
<div className="pager__controls btn-row">
|
||||
<Button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue