+ {/* Header */}
+
+
+ 📋
+
Actions Croisées
+ {actions.length}
+
+ {linkMode ? (
+
+ ) : (
+
+ )}
+
+
+ {/* Selected Items Preview (in link mode) */}
+ {linkMode && selectedItemsData.length > 0 && (
+
+ {selectedItemsData.map((item) => (
+
+ {categoryShort[item.category]}: {item.content.slice(0, 30)}
+ {item.content.length > 30 ? '...' : ''}
+
+ ))}
+
+ )}
+
+ {/* Actions List */}
+ {actions.length === 0 ? (
+
+ Aucune action pour le moment.
+
+ Créez des actions en sélectionnant plusieurs items SWOT.
+
+ ) : (
+
+ {actions.map((action) => (
+
onActionHover(action.links.map((l) => l.swotItemId))}
+ onMouseLeave={onActionLeave}
+ >
+
+
+
+
{action.title}
+
+ {priorityLabels[action.priority]}
+
+
+ {action.description && (
+
{action.description}
+ )}
+
+ {action.links.map((link) => (
+
+ {categoryShort[link.swotItem.category]}
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+ )}
+
+ {/* Create/Edit Modal */}
+
+
+
+
+ );
+}
+
diff --git a/src/components/swot/SwotBoard.tsx b/src/components/swot/SwotBoard.tsx
new file mode 100644
index 0000000..be12543
--- /dev/null
+++ b/src/components/swot/SwotBoard.tsx
@@ -0,0 +1,170 @@
+'use client';
+
+import { useState, useTransition } from 'react';
+import {
+ DragDropContext,
+ Droppable,
+ Draggable,
+ DropResult,
+} from '@hello-pangea/dnd';
+import type { SwotItem, Action, ActionLink, SwotCategory } from '@prisma/client';
+import { SwotQuadrant } from './SwotQuadrant';
+import { SwotCard } from './SwotCard';
+import { ActionPanel } from './ActionPanel';
+import { moveSwotItem } from '@/actions/swot';
+
+type ActionWithLinks = Action & {
+ links: (ActionLink & { swotItem: SwotItem })[];
+};
+
+interface SwotBoardProps {
+ sessionId: string;
+ items: SwotItem[];
+ actions: ActionWithLinks[];
+}
+
+const QUADRANTS: { category: SwotCategory; title: string; icon: string }[] = [
+ { category: 'STRENGTH', title: 'Forces', icon: '💪' },
+ { category: 'WEAKNESS', title: 'Faiblesses', icon: '⚠️' },
+ { category: 'OPPORTUNITY', title: 'Opportunités', icon: '🚀' },
+ { category: 'THREAT', title: 'Menaces', icon: '🛡️' },
+];
+
+export function SwotBoard({ sessionId, items, actions }: SwotBoardProps) {
+ const [isPending, startTransition] = useTransition();
+ const [linkMode, setLinkMode] = useState(false);
+ const [selectedItems, setSelectedItems] = useState