Hid the country manager from the corporate on the payment records
This commit is contained in:
@@ -540,9 +540,25 @@ export default function PaymentRecord() {
|
||||
}
|
||||
};
|
||||
|
||||
const commissionColumn = () => {
|
||||
const hiddenToCorporateColumns = () => {
|
||||
if (user && user.type !== "corporate")
|
||||
return [
|
||||
columnHelper.accessor("agent", {
|
||||
header: "Country Manager",
|
||||
id: "agent",
|
||||
cell: (info) => {
|
||||
const {user, value} = columHelperValue(info.column.id, info);
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"underline text-mti-purple-light hover:text-mti-purple-dark transition ease-in-out duration-300 cursor-pointer",
|
||||
)}
|
||||
onClick={() => setSelectedAgentUser(user)}>
|
||||
{value}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
}),
|
||||
columnHelper.accessor("agentCommission", {
|
||||
header: "Commission",
|
||||
id: "agentCommission",
|
||||
@@ -608,23 +624,7 @@ export default function PaymentRecord() {
|
||||
return <span>{finalValue}</span>;
|
||||
},
|
||||
}),
|
||||
columnHelper.accessor("agent", {
|
||||
header: "Country Manager",
|
||||
id: "agent",
|
||||
cell: (info) => {
|
||||
const {user, value} = columHelperValue(info.column.id, info);
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"underline text-mti-purple-light hover:text-mti-purple-dark transition ease-in-out duration-300 cursor-pointer",
|
||||
)}
|
||||
onClick={() => setSelectedAgentUser(user)}>
|
||||
{value}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
}),
|
||||
...commissionColumn(),
|
||||
...hiddenToCorporateColumns(),
|
||||
columnHelper.accessor("isPaid", {
|
||||
header: "Paid",
|
||||
id: "isPaid",
|
||||
|
||||
Reference in New Issue
Block a user