- Marked tasks in `TODO.md` as completed for moving TFS and Jira services to the `integrations` directory and correcting imports across the codebase. - Updated imports in various action files, API routes, and components to reflect the new structure. - Removed obsolete `jira-advanced-filters.ts`, `jira-analytics.ts`, `jira-analytics-cache.ts`, `jira-anomaly-detection.ts`, `jira-scheduler.ts`, `jira.ts`, and `tfs.ts` files to streamline the codebase. - Added new tasks in `TODO.md` for future cleaning and organization of service imports.
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
'use client';
|
|
|
|
import { Badge } from '@/components/ui/Badge';
|
|
import { JiraAnomaly } from '@/services/integrations/jira/anomaly-detection';
|
|
|
|
interface AnomalySummaryProps {
|
|
anomalies: JiraAnomaly[];
|
|
isExpanded: boolean;
|
|
onToggleExpanded: () => void;
|
|
}
|
|
|
|
export function AnomalySummary({ anomalies, isExpanded, onToggleExpanded }: AnomalySummaryProps) {
|
|
const criticalCount = anomalies.filter(a => a.severity === 'critical').length;
|
|
const highCount = anomalies.filter(a => a.severity === 'high').length;
|
|
const totalCount = anomalies.length;
|
|
|
|
return (
|
|
<div
|
|
className="cursor-pointer hover:bg-[var(--muted)] transition-colors"
|
|
onClick={onToggleExpanded}
|
|
>
|
|
<div className="flex items-center justify-between">
|
|
<div className="flex items-center gap-2">
|
|
<span className="transition-transform duration-200" style={{ transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)' }}>
|
|
▶
|
|
</span>
|
|
<h3 className="font-semibold">🔍 Détection d'anomalies</h3>
|
|
{totalCount > 0 && (
|
|
<div className="flex gap-1">
|
|
{criticalCount > 0 && (
|
|
<Badge className="bg-red-100 text-red-800 text-xs">
|
|
{criticalCount} critique{criticalCount > 1 ? 's' : ''}
|
|
</Badge>
|
|
)}
|
|
{highCount > 0 && (
|
|
<Badge className="bg-orange-100 text-orange-800 text-xs">
|
|
{highCount} élevée{highCount > 1 ? 's' : ''}
|
|
</Badge>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|