fix(lint): escape JSX entities and narrow useEffect dep
Escape French apostrophes/quotes in JSX text per react/no-unescaped-entities and replace the report?.observations.length dependency with a derived observationsCount value so react-hooks/exhaustive-deps is satisfied without re-firing on every report change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3c32f66eb6
commit
a33693580f
6 files changed
+9
-8
No files matched your search
@@ -52,9 +52,10 @@ export default function EditorRoute() {
|
||||
species.pathologies().then((m) => setPathologies(m.default))
|
||||
}, [species])
|
||||
|
||||
const observationsCount = report?.observations.length ?? -1
|
||||
useEffect(() => {
|
||||
if (report && report.observations.length === 0) addObservation()
|
||||
}, [report?.observations.length, addObservation])
|
||||
if (observationsCount === 0) addObservation()
|
||||
}, [observationsCount, addObservation])
|
||||
|
||||
const activeObs = report?.observations[activeIndex]
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export default function HomeRoute() {
|
||||
<Card className="p-6 space-y-4">
|
||||
<h2 className="font-serif text-2xl">Nouveau bilan</h2>
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">
|
||||
Démarrer un nouveau bilan d'ostéopathie sur un animal.
|
||||
Démarrer un nouveau bilan d'ostéopathie sur un animal.
|
||||
</p>
|
||||
<Button onClick={() => navigate('/new')} size="lg">Commencer</Button>
|
||||
</Card>
|
||||
|
||||
@@ -7,8 +7,8 @@ export default function NotFoundRoute() {
|
||||
<main className="min-h-screen grid place-items-center">
|
||||
<div className="text-center space-y-4">
|
||||
<h1 className="font-serif text-4xl">Page introuvable</h1>
|
||||
<p className="text-[var(--color-ink-muted)]">Le chemin demandé n'existe pas.</p>
|
||||
<Button onClick={() => navigate('/')}>Retour à l'accueil</Button>
|
||||
<p className="text-[var(--color-ink-muted)]">Le chemin demandé n'existe pas.</p>
|
||||
<Button onClick={() => navigate('/')}>Retour à l'accueil</Button>
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function DetailModal({
|
||||
/>
|
||||
</div>
|
||||
<p className="mt-4 text-sm text-[var(--color-ink-muted)]">
|
||||
Cliquez sur les zones pour les ajouter à l'observation en cours.
|
||||
Cliquez sur les zones pour les ajouter à l'observation en cours.
|
||||
</p>
|
||||
</Dialog>
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function ObservationList({
|
||||
</div>
|
||||
{observations.length === 0 ? (
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">
|
||||
Aucune observation. Cliquez sur "+ Nouvelle observation" puis sur les zones du schéma.
|
||||
Aucune observation. Cliquez sur "+ Nouvelle observation" puis sur les zones du schéma.
|
||||
</p>
|
||||
) : (
|
||||
<ul className="space-y-2">
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function AnimalForm({ animal, owner, onChangeAnimal, onChangeOwne
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="an-name">Nom de l'animal *</Label>
|
||||
<Label htmlFor="an-name">Nom de l'animal *</Label>
|
||||
<Input id="an-name" required value={animal.name} onChange={(e) => setA({ name: e.target.value })} />
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in new issue
Block a user