From 92a7faef3210659183e86f107e4581d5509a53b8 Mon Sep 17 00:00:00 2001 From: Mayur Shinde Date: Thu, 18 Jun 2026 15:10:22 +0530 Subject: [PATCH] mobile responsive owners box --- .../owner/CommissionDistributionPanel.jsx | 63 +++++++++++++++- src/components/owner/TeamManagementPanel.jsx | 71 +++++++++++++++++-- 2 files changed, 126 insertions(+), 8 deletions(-) diff --git a/src/components/owner/CommissionDistributionPanel.jsx b/src/components/owner/CommissionDistributionPanel.jsx index 1fb68c8..7e41e44 100644 --- a/src/components/owner/CommissionDistributionPanel.jsx +++ b/src/components/owner/CommissionDistributionPanel.jsx @@ -390,7 +390,9 @@ const CommissionDistributionPanel = ({

Add team members with commission rules to see the distribution.

) : ( -
+ <> + {/* ── Desktop table (sm+) ── */} +
@@ -465,6 +467,65 @@ const CommissionDistributionPanel = ({
+ + {/* ── Mobile cards (< sm) ── */} +
+ {filteredRows.length === 0 ? ( +
+ +

No commission entries match the current filters.

+ +
+ ) : ( + <> + {filteredRows.map((row) => ( +
+ {/* Name + Amount */} +
+
+
+ {row.name?.[0] || '?'} +
+ {row.name} +
+ {fmt(row.amount)} +
+ {/* Role */} +
+ + {row.role} + +
+ {/* Project / Type */} +
+
+ Project ID + {row.projectId} +
+
+ Commission Type + {row.commissionType} +
+
+
+ ))} + {/* Total */} +
+ + {hasActiveFilters ? 'Filtered Total' : 'Total'} + + {fmt(total)} +
+ + )} +
+ )}
); diff --git a/src/components/owner/TeamManagementPanel.jsx b/src/components/owner/TeamManagementPanel.jsx index 48fa5ac..7c91694 100644 --- a/src/components/owner/TeamManagementPanel.jsx +++ b/src/components/owner/TeamManagementPanel.jsx @@ -393,8 +393,9 @@ const TeamManagementPanel = ({ transition={{ duration: 0.25 }} className="overflow-hidden" > -
- + {/* ── Desktop table (sm+) ── */} +
+
@@ -419,17 +420,17 @@ const TeamManagementPanel = ({ - - + - -
Member - + {mc.jobRole} {COMMISSION_TYPES[mc.resolved.type] || mc.resolved.type} + {COMMISSION_TYPES[mc.resolved.type] || mc.resolved.type} {mc.resolved.type === 'flat' || mc.resolved.type === 'custom' ? formatCurrency(mc.resolved.rate) : `${mc.resolved.rate}%`} + {formatCurrency(mc.value)} @@ -445,7 +446,7 @@ const TeamManagementPanel = ({
Total Distribution + {formatCurrency(memberCommissions.filter(m => m.status === 'active').reduce((s, mc) => s + mc.value, 0))} @@ -453,6 +454,62 @@ const TeamManagementPanel = ({
+ + {/* ── Mobile cards (< sm) ── */} +
+ {memberCommissions.filter(m => m.status === 'active').map((mc) => { + const srcCfg = COMMISSION_SOURCE_CFG[mc.resolved.source] || COMMISSION_SOURCE_CFG.org; + return ( +
+ {/* Member + source */} +
+
+
+ {mc.name?.[0]} +
+ {mc.name} +
+ + + {srcCfg.label} + +
+ {/* Role */} +
+ + {mc.jobRole} + +
+ {/* Type / Rate / Value */} +
+
+ Type + {COMMISSION_TYPES[mc.resolved.type] || mc.resolved.type} +
+
+ Rate + + {mc.resolved.type === 'flat' || mc.resolved.type === 'custom' + ? formatCurrency(mc.resolved.rate) + : `${mc.resolved.rate}%`} + +
+
+ Value + {formatCurrency(mc.value)} +
+
+
+ ); + })} + {/* Total */} +
+ Total Distribution + + {formatCurrency(memberCommissions.filter(m => m.status === 'active').reduce((s, mc) => s + mc.value, 0))} + +
+
)}