feat: add auth type counts and hide disabled quotas

This commit is contained in:
Supra4E8C
2026-01-31 16:05:48 +08:00
parent 7b77520526
commit 1502e14ca7
4 changed files with 37 additions and 4 deletions

View File

@@ -79,6 +79,9 @@
}
.filterTag {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 6px 14px;
border-radius: 20px;
font-size: 13px;
@@ -97,6 +100,16 @@
font-weight: 600;
}
.filterTagLabel {
white-space: nowrap;
}
.filterTagCount {
font-size: 12px;
font-weight: 600;
opacity: 0.85;
}
.filterControls {
display: flex;
gap: $spacing-md;

View File

@@ -453,6 +453,15 @@ export function AuthFilesPage() {
return Array.from(types);
}, [files]);
const typeCounts = useMemo(() => {
const counts: Record<string, number> = { all: files.length };
files.forEach((file) => {
if (!file.type) return;
counts[file.type] = (counts[file.type] || 0) + 1;
});
return counts;
}, [files]);
// 过滤和搜索
const filtered = useMemo(() => {
return files.filter((item) => {
@@ -1006,7 +1015,8 @@ export function AuthFilesPage() {
setPage(1);
}}
>
{getTypeLabel(type)}
<span className={styles.filterTagLabel}>{getTypeLabel(type)}</span>
<span className={styles.filterTagCount}>{typeCounts[type] ?? 0}</span>
</button>
);
})}