/**
 * 表格分页默认项（桌面端展示完整控件；移动端由 store-theme.less 隐藏跳页并换行）
 */
export const TABLE_PAGINATION_UI = {
  showTotal: true,
  showPageSize: true,
  showJumper: true
}

/**
 * 合并分页状态与 UI 配置，供 a-table :pagination 使用
 * @param {{ pagesize: number, current: number, total: number }} state
 * @param {Record<string, unknown>} [extra]
 */
export function buildTablePagination(state, extra = {}) {
  return {
    ...TABLE_PAGINATION_UI,
    pageSize: state.pagesize,
    current: state.current,
    total: state.total,
    ...extra
  }
}
