import type {TableState} from '@/types/table';

// 创建初始状态
export const createInitialState = <T>(pageSize: number = 10): TableState<T> => ({
    list: [],
    pagination: {
        current: 1,
        pageSize,
        total: 0
    },
    loading: false,
    selectedRows: [],
    selectedRowKeys: []
});

// 处理错误
export const handleTableError = (error: any, message: string) => {
    console.error(message, error);
    return false;
}; 