From 447528ae40ac8671ea50525a8afc68bc1dd77a6c Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 24 Aug 2026 12:50:18 +0000 Subject: [PATCH] 360-partners rendu cliquable comme les autres domaines --- frontend/src/components/Dashboard.jsx | 87 ++++++++++++--------------- 1 file changed, 39 insertions(+), 48 deletions(-) diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index b12a143..31af4fc 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -15,6 +15,38 @@ export default function Dashboard({ token, user }) { const count = (d) => [d.has_cloud, d.has_website, d.has_emails, d.has_team].filter(Boolean).length const color = (n) => n === 0 ? 'bg-slate-600' : n < 3 ? 'bg-amber-500' : 'bg-emerald-500' + const DomainCard = ({ d, badge }) => { + const n = count(d) + const tags = [] + if (d.has_cloud) tags.push(Cloud) + if (d.has_website) tags.push(Site{d.website_wordpress ? ' WP' : ''}) + if (d.has_emails) tags.push({d.email_count} mail{d.email_count > 1 ? 's' : ''}) + if (d.has_team) { const m = JSON.parse(d.team_members || '[]'); tags.push({m.length} user{m.length > 1 ? 's' : ''}) } + if (n === 0) tags.push(Aucun besoin renseigne) + + return ( + +
+
+ {badge && Maitre} +
+

{d.company_name}

+

{d.name}

+
+
+
+
+
{tags}
+ {user.role === 'admin' && d.monthly_price > 0 && ( +
+ {d.monthly_price} EUR/mois +
+ )} + + ) + } + return (
@@ -24,61 +56,20 @@ export default function Dashboard({ token, user }) {

- {domains.parent && ( -
-
-
- - - -
-
-

{domains.parent.company_name}

-

{domains.parent.name} — Entreprise maitre

-
-
-
- )} + {domains.parent && } -
- {domains.children.map(d => { - const n = count(d) - const tags = [] - if (d.has_cloud) tags.push(Cloud) - if (d.has_website) tags.push(Site{d.website_wordpress ? ' WP' : ''}) - if (d.has_emails) tags.push({d.email_count} mail{d.email_count > 1 ? 's' : ''}) - if (d.has_team) { const m = JSON.parse(d.team_members || '[]'); tags.push({m.length} user{m.length > 1 ? 's' : ''}) } - if (n === 0) tags.push(Aucun besoin renseigne) - - return ( - -
-
-

{d.company_name}

-

{d.name}

-
-
-
-
{tags}
- {user.role === 'admin' && d.monthly_price > 0 && ( -
- {d.monthly_price} EUR/mois -
- )} - - ) - })} +
+ {domains.children.map(d => )}
{user.role === 'admin' && (

Resume

-

{domains.children.length}

Domaines

-

{domains.children.filter(d => d.has_cloud).length}

Cloud

-

{domains.children.filter(d => d.has_website).length}

Sites web

-

{domains.children.filter(d => d.has_emails).length}

Avec mails

+

{domains.children.length + 1}

Domaines

+

{[domains.parent, ...domains.children].filter(d => d.has_cloud).length}

Cloud

+

{[domains.parent, ...domains.children].filter(d => d.has_website).length}

Sites web

+

{[domains.parent, ...domains.children].filter(d => d.has_emails).length}

Avec mails

)}