feat(agents): implement grid/list view toggle and enhance filters

- Added grid and list view modes to AgentTypeList with user preference management.
- Enhanced filtering with category selection alongside existing search and status filters.
- Updated AgentTypeDetail with category badges and improved layout.
- Added unit tests for grid/list views and category filtering in AgentTypeList.
- Introduced `@radix-ui/react-toggle-group` for view mode toggle in AgentTypeList.
This commit is contained in:
2026-01-06 18:17:46 +01:00
parent 8e16e2645e
commit 3cb6c8d13b
12 changed files with 1208 additions and 137 deletions

View File

@@ -44,10 +44,10 @@ const DEFAULT_PAGE_LIMIT = 20;
export function useAgentTypes(params: AgentTypeListParams = {}) {
const { user } = useAuth();
const { page = 1, limit = DEFAULT_PAGE_LIMIT, is_active = true, search } = params;
const { page = 1, limit = DEFAULT_PAGE_LIMIT, is_active = true, search, category } = params;
return useQuery({
queryKey: agentTypeKeys.list({ page, limit, is_active, search }),
queryKey: agentTypeKeys.list({ page, limit, is_active, search, category }),
queryFn: async (): Promise<AgentTypeListResponse> => {
const response = await apiClient.instance.get('/api/v1/agent-types', {
params: {
@@ -55,6 +55,7 @@ export function useAgentTypes(params: AgentTypeListParams = {}) {
limit,
is_active,
...(search ? { search } : {}),
...(category ? { category } : {}),
},
});
return response.data;