feat(authFiles): add sorting functionality and update UI components

This commit is contained in:
Supra4E8C
2026-03-17 01:39:38 +08:00
Unverified
parent acddeace52
commit c540063528
4 changed files with 58 additions and 34 deletions
+9
View File
@@ -1,12 +1,21 @@
export const AUTH_FILES_SORT_MODES = ['default', 'az', 'priority'] as const;
export type AuthFilesSortMode = (typeof AUTH_FILES_SORT_MODES)[number];
export type AuthFilesUiState = {
filter?: string;
problemOnly?: boolean;
search?: string;
page?: number;
pageSize?: number;
sortMode?: AuthFilesSortMode;
};
const AUTH_FILES_UI_STATE_KEY = 'authFilesPage.uiState';
const AUTH_FILES_SORT_MODE_SET = new Set<AuthFilesSortMode>(AUTH_FILES_SORT_MODES);
export const isAuthFilesSortMode = (value: unknown): value is AuthFilesSortMode =>
typeof value === 'string' && AUTH_FILES_SORT_MODE_SET.has(value as AuthFilesSortMode);
export const readAuthFilesUiState = (): AuthFilesUiState | null => {
if (typeof window === 'undefined') return null;