refactor(代码重复): 抽取共享工具函数与 UI 组件,消除多处重复实现

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
雨霖铃
2026-06-19 20:55:39 +08:00
parent 47d74f999e
commit 0f3060dcf3
24 changed files with 386 additions and 309 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { StorageCleanerOptions } from '@/types/storage';
export const CLEAN_OPTION_KEYS = [
'localStorage',
'sessionStorage',
'indexedDB',
'cookies',
'cacheStorage',
'serviceWorkers',
] as const satisfies readonly (keyof StorageCleanerOptions)[];
export const OPTION_LABELS: Record<(typeof CLEAN_OPTION_KEYS)[number], string> = {
localStorage: 'Local Storage',
sessionStorage: 'Session Storage',
indexedDB: '站点存储',
cookies: 'Cookies',
cacheStorage: 'Cache Storage',
serviceWorkers: 'Service Workers',
};