mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-08-30 17:56:18 +08:00
feat(providers): add quick fill section in provider category list and update translations
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1487,6 +1487,7 @@
|
||||
},
|
||||
"categories": {
|
||||
"title": "Providers",
|
||||
"quickFill": "Quick Fill",
|
||||
"activeCount": "{{active}}/{{total}} active",
|
||||
"sponsors": "Sponsors"
|
||||
},
|
||||
|
||||
@@ -1465,6 +1465,7 @@
|
||||
},
|
||||
"categories": {
|
||||
"title": "Провайдеры",
|
||||
"quickFill": "Быстрое заполнение",
|
||||
"activeCount": "{{active}}/{{total}} активных",
|
||||
"sponsors": "Спонсоры"
|
||||
},
|
||||
|
||||
@@ -1487,6 +1487,7 @@
|
||||
},
|
||||
"categories": {
|
||||
"title": "提供商",
|
||||
"quickFill": "快速填入",
|
||||
"activeCount": "{{active}}/{{total}} 活跃",
|
||||
"sponsors": "赞助商"
|
||||
},
|
||||
|
||||
@@ -1513,6 +1513,7 @@
|
||||
},
|
||||
"categories": {
|
||||
"title": "提供商",
|
||||
"quickFill": "快速填入",
|
||||
"activeCount": "{{active}}/{{total}} 活躍",
|
||||
"sponsors": "贊助商"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user