chore: clean up code formatting and remove unnecessary whitespace across multiple files for improved readability

This commit is contained in:
Julien Froidefond
2025-12-05 11:05:14 +01:00
parent b3157fffbd
commit 71d850c985
65 changed files with 347 additions and 505 deletions

View File

@@ -22,7 +22,10 @@ interface ActionPanelProps {
onActionLeave: () => void;
}
const categoryBadgeVariant: Record<SwotCategory, 'strength' | 'weakness' | 'opportunity' | 'threat'> = {
const categoryBadgeVariant: Record<
SwotCategory,
'strength' | 'weakness' | 'opportunity' | 'threat'
> = {
STRENGTH: 'strength',
WEAKNESS: 'weakness',
OPPORTUNITY: 'opportunity',
@@ -189,7 +192,12 @@ export function ActionPanel({
className="rounded p-1 text-muted opacity-0 transition-opacity hover:bg-card-hover hover:text-foreground group-hover:opacity-100"
aria-label="Modifier"
>
<svg className="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg
className="h-3.5 w-3.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
@@ -203,7 +211,12 @@ export function ActionPanel({
className="rounded p-1 text-muted opacity-0 transition-opacity hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100"
aria-label="Supprimer"
>
<svg className="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg
className="h-3.5 w-3.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
@@ -271,7 +284,7 @@ export function ActionPanel({
<Modal
isOpen={showModal}
onClose={closeModal}
title={editingAction ? 'Modifier l\'action' : 'Nouvelle action croisée'}
title={editingAction ? "Modifier l'action" : 'Nouvelle action croisée'}
size="lg"
>
<form onSubmit={handleSubmit}>
@@ -339,7 +352,7 @@ export function ActionPanel({
Annuler
</Button>
<Button type="submit" loading={isPending}>
{editingAction ? 'Enregistrer' : 'Créer l\'action'}
{editingAction ? 'Enregistrer' : "Créer l'action"}
</Button>
</ModalFooter>
</form>
@@ -347,4 +360,3 @@ export function ActionPanel({
</div>
);
}

View File

@@ -11,22 +11,17 @@ interface HelpContent {
const HELP_CONTENT: Record<SwotCategory, HelpContent> = {
STRENGTH: {
description:
'Les atouts internes et qualités qui distinguent positivement.',
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 ?',
],
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.',
description: "Les axes d'amélioration et points à travailler.",
examples: [
'Difficulté à déléguer',
'Gestion du stress à améliorer',
@@ -39,22 +34,17 @@ const HELP_CONTENT: Record<SwotCategory, HelpContent> = {
],
},
OPPORTUNITY: {
description:
'Les facteurs externes favorables à saisir.',
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 ?',
],
questions: ["Quelles évolutions pourraient l'aider ?", 'Quelles ressources sont disponibles ?'],
},
THREAT: {
description:
'Les risques externes à anticiper.',
description: 'Les risques externes à anticiper.',
examples: [
'Réorganisation menaçant le poste',
'Compétences devenant obsolètes',
@@ -82,9 +72,10 @@ export function QuadrantHelp({ category }: QuadrantHelpProps) {
className={`
flex h-5 w-5 items-center justify-center rounded-full
text-xs font-medium transition-all
${isOpen
? 'bg-foreground/20 text-foreground rotate-45'
: 'bg-foreground/5 text-muted hover:bg-foreground/10 hover:text-foreground'
${
isOpen
? 'bg-foreground/20 text-foreground rotate-45'
: 'bg-foreground/5 text-muted hover:bg-foreground/10 hover:text-foreground'
}
`}
aria-label="Aide"
@@ -113,9 +104,7 @@ export function QuadrantHelpPanel({ category, isOpen }: QuadrantHelpPanelProps)
<div className="overflow-hidden">
<div className="rounded-lg bg-white/40 dark:bg-black/20 p-3 mb-3">
{/* Description */}
<p className="text-xs text-foreground/80 leading-relaxed">
{content.description}
</p>
<p className="text-xs text-foreground/80 leading-relaxed">{content.description}</p>
<div className="mt-3 flex gap-4">
{/* Examples */}
@@ -125,10 +114,7 @@ export function QuadrantHelpPanel({ category, isOpen }: QuadrantHelpPanelProps)
</h4>
<ul className="space-y-0.5">
{content.examples.map((example, i) => (
<li
key={i}
className="flex items-start gap-1.5 text-xs text-foreground/70"
>
<li key={i} className="flex items-start gap-1.5 text-xs text-foreground/70">
<span className="mt-1.5 h-1 w-1 flex-shrink-0 rounded-full bg-current opacity-50" />
{example}
</li>
@@ -143,10 +129,7 @@ export function QuadrantHelpPanel({ category, isOpen }: QuadrantHelpPanelProps)
</h4>
<ul className="space-y-1">
{content.questions.map((question, i) => (
<li
key={i}
className="text-xs italic text-foreground/60"
>
<li key={i} className="text-xs italic text-foreground/60">
{question}
</li>
))}
@@ -158,4 +141,3 @@ export function QuadrantHelpPanel({ category, isOpen }: QuadrantHelpPanelProps)
</div>
);
}

View File

@@ -1,12 +1,7 @@
'use client';
import { useState, useTransition } from 'react';
import {
DragDropContext,
Droppable,
Draggable,
DropResult,
} from '@hello-pangea/dnd';
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';
@@ -67,9 +62,7 @@ export function SwotBoard({ sessionId, items, actions }: SwotBoardProps) {
if (!linkMode) return;
setSelectedItems((prev) =>
prev.includes(itemId)
? prev.filter((id) => id !== itemId)
: [...prev, itemId]
prev.includes(itemId) ? prev.filter((id) => id !== itemId) : [...prev, itemId]
);
}
@@ -167,4 +160,3 @@ export function SwotBoard({ sessionId, items, actions }: SwotBoardProps) {
</div>
);
}

View File

@@ -120,7 +120,12 @@ export const SwotCard = forwardRef<HTMLDivElement, SwotCardProps>(
className="rounded p-1 text-muted hover:bg-card-hover hover:text-foreground"
aria-label="Modifier"
>
<svg className="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg
className="h-3.5 w-3.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
@@ -137,7 +142,12 @@ export const SwotCard = forwardRef<HTMLDivElement, SwotCardProps>(
className="rounded p-1 text-muted hover:bg-primary/10 hover:text-primary"
aria-label="Dupliquer"
>
<svg className="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg
className="h-3.5 w-3.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
@@ -154,7 +164,12 @@ export const SwotCard = forwardRef<HTMLDivElement, SwotCardProps>(
className="rounded p-1 text-muted hover:bg-destructive/10 hover:text-destructive"
aria-label="Supprimer"
>
<svg className="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg
className="h-3.5 w-3.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
@@ -168,7 +183,9 @@ export const SwotCard = forwardRef<HTMLDivElement, SwotCardProps>(
{/* Selection indicator in link mode */}
{linkMode && isSelected && (
<div className={`absolute -right-1 -top-1 rounded-full bg-card p-0.5 shadow ${styles.text}`}>
<div
className={`absolute -right-1 -top-1 rounded-full bg-card p-0.5 shadow ${styles.text}`}
>
<svg className="h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" />
</svg>
@@ -182,4 +199,3 @@ export const SwotCard = forwardRef<HTMLDivElement, SwotCardProps>(
);
SwotCard.displayName = 'SwotCard';

View File

@@ -92,9 +92,10 @@ export const SwotQuadrant = forwardRef<HTMLDivElement, SwotQuadrantProps>(
className={`
flex h-5 w-5 items-center justify-center rounded-full
text-xs font-medium transition-all
${showHelp
? 'bg-foreground/20 text-foreground'
: 'bg-foreground/5 text-muted hover:bg-foreground/10 hover:text-foreground'
${
showHelp
? 'bg-foreground/20 text-foreground'
: 'bg-foreground/5 text-muted hover:bg-foreground/10 hover:text-foreground'
}
`}
aria-label="Aide"
@@ -112,7 +113,12 @@ export const SwotQuadrant = forwardRef<HTMLDivElement, SwotQuadrantProps>(
aria-label={`Ajouter un item ${title}`}
>
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M12 4v16m8-8H4"
/>
</svg>
</button>
</div>
@@ -166,4 +172,3 @@ export const SwotQuadrant = forwardRef<HTMLDivElement, SwotQuadrantProps>(
);
SwotQuadrant.displayName = 'SwotQuadrant';

View File

@@ -3,4 +3,3 @@ export { SwotQuadrant } from './SwotQuadrant';
export { SwotCard } from './SwotCard';
export { ActionPanel } from './ActionPanel';
export { QuadrantHelp } from './QuadrantHelp';