From 7d951d4532576f9a9e26ca16bfbdd4bb094cae94 Mon Sep 17 00:00:00 2001 From: wahyun Date: Tue, 2 Apr 2024 10:19:55 +0700 Subject: [PATCH] Enterprise condition --- src/views/Master/MasterTransaction/index.js | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/views/Master/MasterTransaction/index.js b/src/views/Master/MasterTransaction/index.js index d8d2449..2d62159 100644 --- a/src/views/Master/MasterTransaction/index.js +++ b/src/views/Master/MasterTransaction/index.js @@ -85,21 +85,25 @@ class index extends Component { , }, - { - title: this.state.role_name === 'Super Admin' ? "Company Name" : null, - dataIndex: "join_first_company_name", - key: "join_first_company_name", - render: (text, record) => { - return this.state.role_name === 'Super Admin' ? ( - {record.join_first_company_name} - ) : null; + ...(this.state.role_name === 'Super Admin' ? [ + { + title: "Company Name", + dataIndex: "join_first_company_name", + key: "join_first_company_name", + render: (text, record) => { + return { record.join_first_company_name }; + } + }] : []) + , + { title: 'Type Paket', dataIndex: 'type_paket', key: 'type_paket', className: "nowrap", + render: (text,record) => { + return { !["Basic","Free"].includes(record.type_paket) ? 'Enterprise' : record.type_paket} } }, - { title: 'Type Paket', dataIndex: 'type_paket', key: 'type_paket', className: "nowrap" }, { title: this.props.t('Expired Date'), dataIndex: 'exp_ospro', key: 'exp_ospro', render: (text,record) => { - return moment(record.exp_ospro).format('DD MMMM, YYYY'); + return { moment(record.exp_ospro).format('DD MMMM, YYYY') }; } }, ];