feat(billing): add all/A/B tabs for formula user filter

Replace the formula assignment dropdown with tab buttons so admins can
quickly view all users or filter by billing formula A or B.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-24 11:36:13 +08:00
parent f9f8b541dc
commit 80c2091baf
+14 -9
View File
@@ -390,6 +390,20 @@ function FormulaAssignmentSection() {
<p className="muted"> A B使 A</p>
{error && <p className="banner banner-error">{error}</p>}
{message && <p className="banner banner-info">{message}</p>}
<div className="admin-tabs billing-formula-filter-tabs" role="tablist" aria-label="按计量公式筛选用户">
{(['all', 'A', 'B'] as const).map((key) => (
<button
key={key}
type="button"
role="tab"
aria-selected={formulaFilter === key}
className={`admin-tab${formulaFilter === key ? ' active' : ''}`}
onClick={() => setFormulaFilter(key)}
>
{key === 'all' ? '全部' : `公式 ${key}`}
</button>
))}
</div>
<div className="billing-toolbar">
<input
className="users-search-input"
@@ -397,15 +411,6 @@ function FormulaAssignmentSection() {
value={search}
onChange={(event) => setSearch(event.target.value)}
/>
<select
className="billing-filter-select"
value={formulaFilter}
onChange={(event) => setFormulaFilter(event.target.value as 'all' | BillingFormulaKey)}
>
<option value="all"></option>
<option value="A"> A</option>
<option value="B"> B</option>
</select>
<button type="button" className="ghost-btn" onClick={() => void reload()} disabled={assigning}>
</button>