feat(FN-1791): add SkillsView component for dashboard
- Add SkillsView component displaying discovered skills with enable/disable toggle - Add skills catalog section with search functionality and debounced query - Add dashboard API client wrappers for skills endpoints (fetchDiscoveredSkills, toggleExecutionSkill, fetchSkillsCatalog) - Add comprehensive tests for SkillsView component (rendering, loading states, error handling, search, toggle) - Remove unused imports and stats variable (useMemo, CatalogFetchResult)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Wrench, RefreshCw, X } from "lucide-react";
|
||||
import {
|
||||
fetchDiscoveredSkills,
|
||||
toggleExecutionSkill,
|
||||
fetchSkillsCatalog,
|
||||
} from "../api";
|
||||
import type { DiscoveredSkill, CatalogEntry, CatalogFetchResult } from "@fusion/dashboard";
|
||||
import type { DiscoveredSkill, CatalogEntry } from "@fusion/dashboard";
|
||||
import type { ToastType } from "../hooks/useToast";
|
||||
|
||||
interface SkillsViewProps {
|
||||
@@ -118,12 +118,6 @@ export function SkillsView({ projectId, addToast, onClose }: SkillsViewProps) {
|
||||
}
|
||||
}, [projectId, addToast]);
|
||||
|
||||
// Stats
|
||||
const stats = useMemo(() => ({
|
||||
discovered: discoveredSkills.length,
|
||||
enabled: discoveredSkills.filter((s) => s.enabled).length,
|
||||
catalogEntries: catalogEntries.length,
|
||||
}), [discoveredSkills, catalogEntries]);
|
||||
|
||||
return (
|
||||
<div className="skills-view" data-testid="skills-view">
|
||||
|
||||
Reference in New Issue
Block a user