diff --git a/src/components/Tenant/Profile.jsx b/src/components/Tenant/Profile.jsx index df7976cd..c8f30f72 100644 --- a/src/components/Tenant/Profile.jsx +++ b/src/components/Tenant/Profile.jsx @@ -84,24 +84,29 @@ const Profile = ({ data }) => {
Organization
-
+
Industry: {data?.industry?.name}
{data?.taxId && ( -
+
Tax Id: {data?.taxId}
)} -
+
Organization Size: {data?.organizationSize}
+
+ + Seat Available: + {data?.seatsAvailable} +
On-Boarding Date: diff --git a/src/components/Tenant/SubScriptionHistory.jsx b/src/components/Tenant/SubScriptionHistory.jsx index 2aa0a32d..56b7638b 100644 --- a/src/components/Tenant/SubScriptionHistory.jsx +++ b/src/components/Tenant/SubScriptionHistory.jsx @@ -64,78 +64,50 @@ const SubScriptionHistory = ({ tenantId }) => { if (percentage < 80) return "warning"; return "danger"; }; - // const SubscriptionColumns = [ - // { - // key: "createdAt", - // label: "Date", - // getValue: (e) => formatUTCToLocalTime(e?.createdAt), - // align: "text-start", - // }, - // { - // key: "frequency", - // label: "Type", - // getValue: (e) => { - // switch (e.frequency) { - // case 1: - // return "Monthly"; - // case 3: - // return "Quarterly"; - // case 12: - // return "Yearly"; - // default: - // return "N/A"; - // } - // }, - // align: "text-start", - // }, - // { - // key: "price", - // label: "Amount", - // getValue: (e) => ( - // <> - // {e.currency?.symbol || "₹"} {e.price} - // - // ), - // align: "text-end", - // }, - // { - // key: "submittedBy", - // label: "Submitted By", - // getValue: (e) => - // `${e.createdBy?.firstName ?? ""} ${ - // e.createdBy?.lastName ?? "" - // }`.trim() || "N/A", - // customRender: (e) => ( - //
- // - // - // {`${e.createdBy?.firstName ?? ""} ${ - // e.createdBy?.lastName ?? "" - // }`.trim() || "N/A"} - // - //
- // ), - // align: "text-start", - // }, - // { - // key: "action", - // label: "Action", - // customRender: (e) => ( - // - // ), - // align: "text-center", - // }, - // ]; + const SubscriptionColumns = [ + { + key: "createdAt", + label: "Date", + getValue: (e) => formatUTCToLocalTime(e?.createdAt), + align: "text-start", + }, + { + key: "frequency", + label: "Type", + getValue: (e) => + SUBSCRIPTION_PLAN_FREQUENCIES[e.frequency] || "N/A", + align: "text-start", + }, + { + key: "price", + label: "Amount", + getValue: (e) => ( + <> + {e.currency?.symbol || "₹"} {e.price} + + ), + align: "text-end pe-4", + }, + { + key: "planName", + label: "Plan Name", + getValue: (e) => e.planName, + align: "text-start ps-4", + }, + { + key: "action", + label: "Action", + getValue: (e) => ( + console.log("Download clicked for", e.id)} + role="button" + /> + ), + align: "text-center", + }, +]; + return (
@@ -186,37 +158,31 @@ const SubScriptionHistory = ({ tenantId }) => {
- - - - - - - - - - - {data?.subscriptionHistery?.map((item) => ( - - - - - - - - ))} - -
DateTypeAmountPlan NameAction
{formatUTCToLocalTime(item.createdAt)} - {SUBSCRIPTION_PLAN_FREQUENCIES[item.frequency] || "N/A"} - - - {" "} - {item.currency?.symbol} - {item.price} - - {item.planName} - -
+ + + {SubscriptionColumns.map((col) => ( + + {col.label} + + ))} + + + + {data?.subscriptionHistery + ?.slice() + .sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt)) // latest first + .map((item) => ( + + {SubscriptionColumns.map((col) => ( + + {col.getValue ? col.getValue(item) : item[col.key] || "N/A"} + + ))} + + ))} + + +
);