feat(providers): add quick fill section in provider category list and update translations

This commit is contained in:
Supra4E8C
2026-07-06 17:03:24 +08:00
parent e43df69c8c
commit 9d3e82e99a
5 changed files with 16 additions and 1 deletions
@@ -9,9 +9,14 @@ interface ProviderCategoryListProps {
onSelect: (brand: ProviderBrand) => void;
}
const QUICK_FILL_BRANDS: ReadonlySet<ProviderBrand> = new Set(['code0', 'claudeApi']);
export function ProviderCategoryList({ groups, activeBrand, onSelect }: ProviderCategoryListProps) {
const { t } = useTranslation();
const quickFillGroups = groups.filter((g) => QUICK_FILL_BRANDS.has(g.id));
const providerGroups = groups.filter((g) => !QUICK_FILL_BRANDS.has(g.id));
const renderGroups = (items: ProviderGroup[]) => (
<div className={styles.list}>
{items.map((group) => {
@@ -84,8 +89,14 @@ export function ProviderCategoryList({ groups, activeBrand, onSelect }: Provider
<div className={styles.stack}>
<aside className={styles.aside}>
<p className={styles.eyebrow}>{t('providersPage.categories.title')}</p>
{renderGroups(groups)}
{renderGroups(providerGroups)}
</aside>
{quickFillGroups.length > 0 && (
<aside className={styles.aside}>
<p className={styles.eyebrow}>{t('providersPage.categories.quickFill')}</p>
{renderGroups(quickFillGroups)}
</aside>
)}
</div>
);
}
+1
View File
@@ -1487,6 +1487,7 @@
},
"categories": {
"title": "Providers",
"quickFill": "Quick Fill",
"activeCount": "{{active}}/{{total}} active",
"sponsors": "Sponsors"
},
+1
View File
@@ -1465,6 +1465,7 @@
},
"categories": {
"title": "Провайдеры",
"quickFill": "Быстрое заполнение",
"activeCount": "{{active}}/{{total}} активных",
"sponsors": "Спонсоры"
},
+1
View File
@@ -1487,6 +1487,7 @@
},
"categories": {
"title": "提供商",
"quickFill": "快速填入",
"activeCount": "{{active}}/{{total}} 活跃",
"sponsors": "赞助商"
},
+1
View File
@@ -1513,6 +1513,7 @@
},
"categories": {
"title": "提供商",
"quickFill": "快速填入",
"activeCount": "{{active}}/{{total}} 活躍",
"sponsors": "贊助商"
},