fix(rapport): patch temporaire conclusion conseil_nclc quand NCLC dépassé (FTD-40, FTD-41)

This commit is contained in:
Hermann_Kitio 2026-04-25 21:16:00 +03:00
parent 822b02a2d1
commit 06fbfe3f9b
4 changed files with 148 additions and 33 deletions

View file

@ -9,13 +9,20 @@
import ReactMarkdown from 'react-markdown'
import { Card } from '@/shared/ui/Card'
import type { ConseilNclc } from '@/entities/report/types'
import type { ConseilNclc, NclcCible } from '@/entities/report/types'
interface Props {
conseil: ConseilNclc
nclc: number
nclcCible: NclcCible
}
export function ConseilNclcCallout({ conseil }: Props) {
export function ConseilNclcCallout({ conseil, nclc, nclcCible }: Props) {
// PATCH TEMPORAIRE — à retirer quand FTD-40 (fix prompt backend) est résolu.
// Le prompt maître DeepSeek génère un message d'encouragement vers `nclcCible`
// même quand `nclc > nclcCible` ; on substitue alors un texte cohérent.
const depasse = nclc > nclcCible
return (
<section aria-label="Plan d'action NCLC">
<h2 className="mb-3 text-base font-semibold text-ink-primary">Plan d'action NCLC</h2>
@ -35,9 +42,16 @@ export function ConseilNclcCallout({ conseil }: Props) {
Action prioritaire
</p>
<div className="text-sm leading-relaxed text-ink-primary">
<ReactMarkdown disallowedElements={['script', 'iframe']}>
{conseil.action_prioritaire}
</ReactMarkdown>
{depasse ? (
<p>
Excellent travail vous avez dépassé votre objectif. Continuez sur cette lancée
pour viser NCLC {nclc + 1} !
</p>
) : (
<ReactMarkdown disallowedElements={['script', 'iframe']}>
{conseil.action_prioritaire}
</ReactMarkdown>
)}
</div>
</div>
</Card>