Refactor UserTypeFilter component to use Chips for selection and update user type filtering logic

This commit is contained in:
AshAnand34
2025-07-21 21:22:05 -07:00
parent b29845c2d3
commit 1cae1c9fda
4 changed files with 38 additions and 60 deletions

View File

@@ -8,7 +8,6 @@ export type UserType =
| 'General Users'
| 'Developers'
| 'Designers'
| 'Students'
| 'CyberSec';
export interface ToolMeta {

View File

@@ -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;