diff --git a/dev.db b/dev.db index 26e613c..c7b9a98 100644 Binary files a/dev.db and b/dev.db differ diff --git a/src/components/swot/QuadrantHelp.tsx b/src/components/swot/QuadrantHelp.tsx new file mode 100644 index 0000000..12aca74 --- /dev/null +++ b/src/components/swot/QuadrantHelp.tsx @@ -0,0 +1,161 @@ +'use client'; + +import { useState } from 'react'; +import type { SwotCategory } from '@prisma/client'; + +interface HelpContent { + description: string; + examples: string[]; + questions: string[]; +} + +const HELP_CONTENT: Record = { + STRENGTH: { + description: + 'Les atouts internes et qualités qui distinguent positivement.', + examples: [ + 'Expertise technique solide', + 'Excellentes capacités de communication', + 'Leadership naturel', + 'Rigueur et organisation', + ], + questions: [ + 'Qu\'est-ce qui le/la distingue ?', + 'Quels retours positifs reçoit-il/elle ?', + ], + }, + WEAKNESS: { + description: + 'Les axes d\'amélioration et points à travailler.', + examples: [ + 'Difficulté à déléguer', + 'Gestion du stress à améliorer', + 'Communication écrite perfectible', + 'Manque de visibilité en réunion', + ], + questions: [ + 'Quels feedbacks constructifs a-t-il/elle reçus ?', + 'Quelles situations le/la mettent en difficulté ?', + ], + }, + OPPORTUNITY: { + description: + 'Les facteurs externes favorables à saisir.', + examples: [ + 'Nouveau projet stratégique', + 'Formation disponible', + 'Poste ouvert en interne', + 'Mentor potentiel identifié', + ], + questions: [ + 'Quelles évolutions pourraient l\'aider ?', + 'Quelles ressources sont disponibles ?', + ], + }, + THREAT: { + description: + 'Les risques externes à anticiper.', + examples: [ + 'Réorganisation menaçant le poste', + 'Compétences devenant obsolètes', + 'Concurrence interne forte', + 'Budget formation réduit', + ], + questions: [ + 'Quels changements pourraient impacter négativement ?', + 'Quels risques sont à anticiper ?', + ], + }, +}; + +interface QuadrantHelpProps { + category: SwotCategory; +} + +export function QuadrantHelp({ category }: QuadrantHelpProps) { + const [isOpen, setIsOpen] = useState(false); + const content = HELP_CONTENT[category]; + + return ( + + ); +} + +interface QuadrantHelpPanelProps { + category: SwotCategory; + isOpen: boolean; +} + +export function QuadrantHelpPanel({ category, isOpen }: QuadrantHelpPanelProps) { + const content = HELP_CONTENT[category]; + + return ( +
+
+
+ {/* Description */} +

+ {content.description} +

+ +
+ {/* Examples */} +
+

+ 📝 Exemples +

+
    + {content.examples.map((example, i) => ( +
  • + + {example} +
  • + ))} +
+
+ + {/* Questions */} +
+

+ 💡 Questions +

+
    + {content.questions.map((question, i) => ( +
  • + {question} +
  • + ))} +
+
+
+
+
+
+ ); +} + diff --git a/src/components/swot/SwotQuadrant.tsx b/src/components/swot/SwotQuadrant.tsx index d1cc41c..492fa21 100644 --- a/src/components/swot/SwotQuadrant.tsx +++ b/src/components/swot/SwotQuadrant.tsx @@ -3,6 +3,7 @@ import { forwardRef, useState, useTransition, ReactNode } from 'react'; import type { SwotCategory } from '@prisma/client'; import { createSwotItem } from '@/actions/swot'; +import { QuadrantHelpPanel } from './QuadrantHelp'; interface SwotQuadrantProps { category: SwotCategory; @@ -41,6 +42,7 @@ export const SwotQuadrant = forwardRef( const [isAdding, setIsAdding] = useState(false); const [newContent, setNewContent] = useState(''); const [isPending, startTransition] = useTransition(); + const [showHelp, setShowHelp] = useState(false); const styles = categoryStyles[category]; @@ -81,10 +83,25 @@ export const SwotQuadrant = forwardRef( {...props} > {/* Header */} -
+
{icon}

{title}

+
+ {/* Help Panel */} + + {/* Items */}
{children} diff --git a/src/components/swot/index.ts b/src/components/swot/index.ts index 907dc01..340652d 100644 --- a/src/components/swot/index.ts +++ b/src/components/swot/index.ts @@ -2,4 +2,5 @@ export { SwotBoard } from './SwotBoard'; export { SwotQuadrant } from './SwotQuadrant'; export { SwotCard } from './SwotCard'; export { ActionPanel } from './ActionPanel'; +export { QuadrantHelp } from './QuadrantHelp';