From 63864a991be0a6f3886fb4c97f82adac36df5715 Mon Sep 17 00:00:00 2001 From: lfirmin Date: Thu, 26 Feb 2026 03:39:49 +0100 Subject: [PATCH] edit mutuel panel --- public/mutuelles.json | 95 +++++++++++++++++ src/components/ComparisonSection.jsx | 146 ++++++++++++++++----------- src/components/Footer.jsx | 12 +-- src/components/GuideSection.jsx | 2 +- src/components/MutuelleCard.jsx | 88 ++++++++-------- src/components/Navbar.jsx | 2 +- src/hooks/useMutuelles.js | 25 +++++ 7 files changed, 263 insertions(+), 107 deletions(-) create mode 100644 public/mutuelles.json create mode 100644 src/hooks/useMutuelles.js diff --git a/public/mutuelles.json b/public/mutuelles.json new file mode 100644 index 0000000..8254de4 --- /dev/null +++ b/public/mutuelles.json @@ -0,0 +1,95 @@ +{ + "mutuelles": [ + { + "rang": 1, + "nom": "Experia conseil", + "slogan": "Experia conseil", + "couleur": "#2563EB", + "initiales": "NCA", + "meilleurChoix": true, + "tags": ["Actifs", "Seniors"], + "couvertures": { "soins": 3, "dentaire": 2, "optique": 3 }, + "score": 9.8, + "promo": null, + "lien": "https://experia-conseils.fr/" + }, + { + "rang": 2, + "nom": "ECG", + "slogan": "groupe pereire", + "couleur": "#1444ff", + "initiales": "ID", + "meilleurChoix": false, + "tags": ["Actifs"], + "couvertures": { "soins": 3, "dentaire": 2, "optique": 3 }, + "score": 9.5, + "promo": null, + "lien": "https://pereire.co/" + }, + { + "rang": 3, + "nom": "JSC santé", + "slogan": "Excellent rapport qualité-prix", + "couleur": "#FF1111", + "initiales": "YE", + "meilleurChoix": false, + "tags": ["Actifs", "Familles"], + "couvertures": { "soins": 3, "dentaire": 3, "optique": 2 }, + "score": 9.3, + "promo": null, + "lien": "https://www.jscsante.fr/" + }, + { + "rang": 4, + "nom": "Biomay", + "slogan": "Excellence pour seniors", + "couleur": "#2563EB", + "initiales": "SM", + "meilleurChoix": false, + "tags": ["Seniors"], + "couvertures": { "soins": 3, "dentaire": 3, "optique": 3 }, + "score": 9.1, + "promo": null, + "lien": "https://www.biomay.fr/" + }, + { + "rang": 5, + "nom": "NCA", + "slogan": "Flexibilité maximale", + "couleur": "#0891B2", + "initiales": "AP", + "meilleurChoix": false, + "tags": ["Seniors", "Indépendants"], + "couvertures": { "soins": 2, "dentaire": 3, "optique": 3 }, + "score": 8.9, + "promo": null, + "lien": "https://ncassurances.net/" + }, + { + "rang": 6, + "nom": "Helse", + "slogan": "Rapport qualité-prix optimal", + "couleur": "#059669", + "initiales": "HE", + "meilleurChoix": false, + "tags": ["Actifs", "Étudiants"], + "couvertures": { "soins": 2, "dentaire": 2, "optique": 3 }, + "score": 8.7, + "promo": null, + "lien": "https://www.helse.fr" + }, + { + "rang": 7, + "nom": "Helse", + "slogan": "Rapport qualité-prix optimal", + "couleur": "#059669", + "initiales": "HE", + "meilleurChoix": false, + "tags": ["Actifs", "Étudiants"], + "couvertures": { "soins": 2, "dentaire": 2, "optique": 3 }, + "score": 8.7, + "promo": null, + "lien": "https://www.helse.fr" + } + ] +} diff --git a/src/components/ComparisonSection.jsx b/src/components/ComparisonSection.jsx index bda99ca..221554a 100644 --- a/src/components/ComparisonSection.jsx +++ b/src/components/ComparisonSection.jsx @@ -1,7 +1,7 @@ import { motion } from 'framer-motion' import { FiAward, FiArrowRight } from 'react-icons/fi' -import { mutuelles } from '../data/mutuelles' -import MutuelleCard from './MutuelleCard' +import { useMutuelles } from '../hooks/useMutuelles' +import MutuelleCard, { LogoMutuelle } from './MutuelleCard' const medals = ['🏆', '🥈', '🥉'] @@ -16,36 +16,31 @@ function TopCard({ mutuelle, index }) { : 'border-slate-100 bg-white hover:border-slate-200 shadow-sm' }`} > - {/* Badge */} - {isFirst && ( + {/* Badge meilleur choix */} + {mutuelle.meilleurChoix && (
⭐ Meilleur Choix 2026
)}
- {/* Logo */} -
- {mutuelle.initials} -
+ {/* Logo (favicon ou initiales) */} + - {/* Medal + rank */} + {/* Médaille */} {medals[index]}
-
{mutuelle.name}
-
{mutuelle.tagline}
+
{mutuelle.nom}
+
{mutuelle.slogan}
{/* Tags */}
- {mutuelle.idealFor.map((tag) => ( + {mutuelle.tags.map((tag) => ( {tag} @@ -53,33 +48,55 @@ function TopCard({ mutuelle, index }) {
{/* Promo */} - {mutuelle.offer && ( + {mutuelle.promo && (
- 🎁 {mutuelle.offer} + 🎁 {mutuelle.promo}
)} {/* Score + CTA */}
-
+
{mutuelle.score} /10
Score Mon Gaston
- + +
+
+ ) +} + +function LoadingSkeleton() { + return ( +
+
+ {[1, 2, 3].map((i) => ( +
+ ))} +
+
+ {[1, 2, 3, 4, 5, 6].map((i) => ( +
+ ))}
) } export default function ComparisonSection() { + const { mutuelles, loading, error } = useMutuelles() + return (
@@ -99,44 +116,57 @@ export default function ComparisonSection() {

- {/* Top 3 grid */} -
- {mutuelles.slice(0, 3).map((m, i) => ( - - - - ))} -
+ {/* Erreur */} + {error && ( +
{error}
+ )} - {/* Divider */} -
-
- - Classement complet - -
-
+ {/* Chargement */} + {loading && !error && } - {/* Full list */} -
- {mutuelles.map((m, i) => ( - - - - ))} -
+ {/* Contenu */} + {!loading && !error && ( + <> + {/* Top 3 */} +
+ {mutuelles.slice(0, 3).map((m, i) => ( + + + + ))} +
+ + {/* Séparateur */} +
+
+ + Classement complet + +
+
+ + {/* Liste complète */} +
+ {mutuelles.map((m, i) => ( + + + + ))} +
+ + )}
) diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 3e38984..2f2e8af 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -36,7 +36,7 @@ const socials = [ export default function Footer() { return ( -
+
{/* Main grid */} @@ -49,26 +49,26 @@ export default function Footer() {
- Mon Gaston + AssurezMoi
Votre comparateur d'assurances
- 33 avenue Roger Salengro
+ 1 Rue john doe
59100 Roubaix, France
- contact@mongaston.com + contact@assurezmoi.com
- 01 80 89 10 30 + 01 02 03 04 05
@@ -133,7 +133,7 @@ export default function Footer() { {/* Bottom bar */}

- © 2026 Mon Gaston — Tous droits réservés. + © 2026 AssurezMoi — Tous droits réservés. · Comparateur de mutuelles santé & assurances

diff --git a/src/components/GuideSection.jsx b/src/components/GuideSection.jsx index c1998e6..b11eae1 100644 --- a/src/components/GuideSection.jsx +++ b/src/components/GuideSection.jsx @@ -82,7 +82,7 @@ export default function GuideSection() {
{/* Sidebar */} -
+
{/* Guides card */} diff --git a/src/components/MutuelleCard.jsx b/src/components/MutuelleCard.jsx index 51670c7..3fa3cc7 100644 --- a/src/components/MutuelleCard.jsx +++ b/src/components/MutuelleCard.jsx @@ -1,22 +1,32 @@ +import { useState } from 'react' import { FiArrowRight, FiActivity, FiEye, FiSmile } from 'react-icons/fi' -import { MdLocalHospital } from 'react-icons/md' -const hospConfig = { - orange: { - bg: 'bg-orange-50', - text: 'text-orange-700', - border: 'border-orange-200', - }, - green: { - bg: 'bg-emerald-50', - text: 'text-emerald-700', - border: 'border-emerald-200', - }, - teal: { - bg: 'bg-teal-50', - text: 'text-teal-700', - border: 'border-teal-200', - }, +// Favicon auto-chargé depuis le lien, fallback sur les initiales +export function LogoMutuelle({ mutuelle, className = '' }) { + const [faviconError, setFaviconError] = useState(false) + + const faviconUrl = + mutuelle.lien && !faviconError + ? `https://www.google.com/s2/favicons?sz=64&domain_url=${encodeURIComponent(mutuelle.lien)}` + : null + + return ( +
+ {faviconUrl ? ( + setFaviconError(true)} + /> + ) : ( + {mutuelle.initiales} + )} +
+ ) } function FeatureDots({ count }) { @@ -54,8 +64,7 @@ function ScoreBar({ score, color }) { } export default function MutuelleCard({ mutuelle }) { - const hosp = hospConfig[mutuelle.hospColor] || hospConfig.teal - const isFirst = mutuelle.rank === 1 + const isFirst = mutuelle.rang === 1 return (
- {/* Rank badge */} + {/* Rang */}
- {mutuelle.rank} + {mutuelle.rang}
- {/* Logo */} -
- {mutuelle.initials} -
+ {/* Logo (favicon ou initiales) */} + - {/* Name + tags */} + {/* Nom + tags */}
- {mutuelle.name} - {isFirst && ( + {mutuelle.nom} + {mutuelle.meilleurChoix && ( ⭐ Meilleur Choix )}
- {mutuelle.idealFor.map((tag) => ( + {mutuelle.tags.map((tag) => (
- {/* Features */} + {/* Points de couverture */}
Soins - +
Dentaire - +
Optique - +
- {/* Score */}
- +
{/* CTA */} - +
) } diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 0fd1ea3..f022f42 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -25,7 +25,7 @@ export default function Navbar() {
- Mon Gaston + AssurezMoi diff --git a/src/hooks/useMutuelles.js b/src/hooks/useMutuelles.js new file mode 100644 index 0000000..4fbd812 --- /dev/null +++ b/src/hooks/useMutuelles.js @@ -0,0 +1,25 @@ +import { useState, useEffect } from 'react' + +export function useMutuelles() { + const [mutuelles, setMutuelles] = useState([]) + const [loading, setLoading] = useState(true) + const [error, setError] = useState(null) + + useEffect(() => { + fetch('/mutuelles.json') + .then((res) => { + if (!res.ok) throw new Error('Impossible de charger les données') + return res.json() + }) + .then((data) => { + setMutuelles(data.mutuelles) + setLoading(false) + }) + .catch((err) => { + setError(err.message) + setLoading(false) + }) + }, []) + + return { mutuelles, loading, error } +}