feat: AIPresetModal - 'Người dùng' filter for user-defined presets
Add 'Người dùng' category to filter dropdown. Filter logic checks p.is_user_defined when this category is selected. Shows only presets the user has created/added.
This commit is contained in:
@@ -4409,7 +4409,7 @@ const AIPresetModal = ({ isOpen, onClose }) => {
|
|||||||
showToast('Đã lưu preset thành công!', 'success');
|
showToast('Đã lưu preset thành công!', 'success');
|
||||||
};
|
};
|
||||||
|
|
||||||
const categories = ['ALL', '★ Yêu thích', ...new Set(presets.map(p => p.category))];
|
const categories = ['ALL', '★ Yêu thích', 'Người dùng', ...new Set(presets.map(p => p.category))];
|
||||||
|
|
||||||
const filtered = presets.filter(p => {
|
const filtered = presets.filter(p => {
|
||||||
const matchesSearch = p.name.toLowerCase().includes(search.toLowerCase()) ||
|
const matchesSearch = p.name.toLowerCase().includes(search.toLowerCase()) ||
|
||||||
@@ -4419,6 +4419,8 @@ const AIPresetModal = ({ isOpen, onClose }) => {
|
|||||||
matchesCategory = true;
|
matchesCategory = true;
|
||||||
} else if (filterCategory === '★ Yêu thích') {
|
} else if (filterCategory === '★ Yêu thích') {
|
||||||
matchesCategory = p.is_favorite;
|
matchesCategory = p.is_favorite;
|
||||||
|
} else if (filterCategory === 'Người dùng') {
|
||||||
|
matchesCategory = p.is_user_defined;
|
||||||
} else {
|
} else {
|
||||||
matchesCategory = p.category === filterCategory;
|
matchesCategory = p.category === filterCategory;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user