🔧 fix: filter out empty string group from pricing groups selector (#1365)

Filter out the special empty string group ("": "用户分组") from the
usable groups in PricingGroups component. This empty group represents
"user's current group" but contains no data and should not be displayed
in the group filter options.

- Add filter condition to exclude empty string keys from usableGroup
- Prevents displaying invalid empty group option in UI
- Improves user experience by showing only valid selectable groups
This commit is contained in:
t0ng7u
2025-07-23 10:04:32 +08:00
parent 3f96bd9509
commit 8a54512037

View File

@@ -30,7 +30,7 @@ import SelectableButtonGroup from '../../../common/ui/SelectableButtonGroup';
* @param {Function} t i18n
*/
const PricingGroups = ({ filterGroup, setFilterGroup, usableGroup = {}, models = [], loading = false, t }) => {
const groups = ['all', ...Object.keys(usableGroup)];
const groups = ['all', ...Object.keys(usableGroup).filter(key => key !== '')];
const items = groups.map((g) => {
let count = 0;