feat: Add endpoint type filter to model pricing system

- Create PricingEndpointTypes.jsx component for endpoint type filtering
- Add filterEndpointType state management in useModelPricingData hook
- Integrate endpoint type filtering logic in filteredModels computation
- Update PricingSidebar.jsx to include endpoint type filter component
- Update PricingFilterModal.jsx to support endpoint type filtering on mobile
- Extend resetPricingFilters utility function to include endpoint type reset
- Support filtering models by endpoint types (OpenAI, Anthropic, Gemini, etc.)
- Display model count for each endpoint type with localized labels
- Ensure filter state resets to first page when endpoint type changes

This enhancement allows users to filter models by their supported endpoint types,
providing more granular control over model selection in the pricing interface.
This commit is contained in:
t0ng7u
2025-07-24 03:25:57 +08:00
parent 53be79a00e
commit 59a76b3970
5 changed files with 135 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import { Button } from '@douyinfe/semi-ui';
import PricingCategories from '../filter/PricingCategories';
import PricingGroups from '../filter/PricingGroups';
import PricingQuotaTypes from '../filter/PricingQuotaTypes';
import PricingEndpointTypes from '../filter/PricingEndpointTypes';
import PricingDisplaySettings from '../filter/PricingDisplaySettings';
import { resetPricingFilters } from '../../../../helpers/utils';
@@ -40,6 +41,8 @@ const PricingSidebar = ({
setFilterGroup,
filterQuotaType,
setFilterQuotaType,
filterEndpointType,
setFilterEndpointType,
currentPage,
setCurrentPage,
loading,
@@ -58,6 +61,7 @@ const PricingSidebar = ({
setViewMode,
setFilterGroup,
setFilterQuotaType,
setFilterEndpointType,
setCurrentPage,
});
@@ -114,6 +118,14 @@ const PricingSidebar = ({
loading={loading}
t={t}
/>
<PricingEndpointTypes
filterEndpointType={filterEndpointType}
setFilterEndpointType={setFilterEndpointType}
models={categoryProps.models}
loading={loading}
t={t}
/>
</div>
);
};