mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
Refactor UserTypeFilter component to use Chips for selection and update user type filtering logic
This commit is contained in:
@@ -8,7 +8,6 @@ export type UserType =
|
||||
| 'General Users'
|
||||
| 'Developers'
|
||||
| 'Designers'
|
||||
| 'Students'
|
||||
| 'CyberSec';
|
||||
|
||||
export interface ToolMeta {
|
||||
|
||||
@@ -145,6 +145,10 @@ export const filterToolsByUserTypes = (
|
||||
if (userTypes.length === 0) return tools;
|
||||
|
||||
return tools.filter((tool) => {
|
||||
// Always treat xml tools as dev-only
|
||||
if (tool.type === 'xml') {
|
||||
return userTypes.includes('Developers');
|
||||
}
|
||||
// If tool has no userTypes defined, show it to all users
|
||||
if (!tool.userTypes || tool.userTypes.length === 0) return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user