- {!servicesLoading && assignedServices && (
- <>
- {assignedServices.length === 1 && (
-
- )}
-
- {assignedServices.length > 1 && (
-
{
const inputRef = useRef(null);
@@ -105,7 +106,7 @@ export const DateRangePicker1 = ({
const applyDefaultDates = () => {
const today = new Date();
const past = new Date();
- past.setDate(today.getDate() - 6);
+ past.setDate(today.getDate() - pastDays);
const format = (d) => flatpickr.formatDate(d, "d-m-Y");
const formattedStart = format(past);
diff --git a/src/components/reports/Progress.jsx b/src/components/reports/Progress.jsx
index 89d1dfca..3625ff19 100644
--- a/src/components/reports/Progress.jsx
+++ b/src/components/reports/Progress.jsx
@@ -8,7 +8,7 @@ const Progress = ({
total = 0,
height = 100,
width = 100,
- completed =0,
+ completed = 0,
}) => {
const options = {
chart: {
@@ -24,16 +24,19 @@ const Progress = ({
value: {
show: true,
fontSize: "13px",
- width:"12px",
- textWrap:"wrap",
+ width: "12px",
+ textWrap: "wrap",
color: color,
fontWeight: 400,
offsetY: 7,
- formatter: () => `${formatFigure(completed,{notation:"compact"})} / ${formatFigure(total,{notation:"compact"})}`,
+ formatter: () =>
+ `${formatFigure(completed, {
+ notation: "compact",
+ })} / ${formatFigure(total, { notation: "compact" })}`,
+ },
+ style: {
+ textWrap: "wrap",
},
- style:{
- textWrap:"wrap",
- }
},
},
},
@@ -54,7 +57,6 @@ const Progress = ({
};
export default Progress;
-
// const Progress = ({
// completed = 0,
// inProgress = 0,
diff --git a/src/components/reports/ReportsDonutCard.jsx b/src/components/reports/ReportsDonutCard.jsx
index d922c4cc..a6d0dcdb 100644
--- a/src/components/reports/ReportsDonutCard.jsx
+++ b/src/components/reports/ReportsDonutCard.jsx
@@ -9,9 +9,11 @@ const ReportsDonutCard = ({
donutClass = "",
footer = "Team members present on the site",
chartColor,
+ legend1 = "Completed",
+ legend2 = "Pending",
}) => {
return (
-
+
{title}
@@ -24,7 +26,7 @@ const ReportsDonutCard = ({
completed={value}
total={total}
/>
-
+
@@ -51,7 +53,6 @@ export const ReportsCard = ({
@@ -62,5 +63,3 @@ export const ReportsCard = ({
);
};
-
-
diff --git a/src/components/reports/ReportsLegend.jsx b/src/components/reports/ReportsLegend.jsx
index cd2a533c..daea7b0a 100644
--- a/src/components/reports/ReportsLegend.jsx
+++ b/src/components/reports/ReportsLegend.jsx
@@ -1,19 +1,14 @@
-const ReportsLegend = () => {
+const ReportsLegend = ({legend1, legend2}) => {
return (
- Completed
+ {legend1}
- In Progress
-
-
-
-
- Pending
+ {legend2}
);
diff --git a/src/components/reports/report-dpr.jsx b/src/components/reports/report-dpr.jsx
index 4ecc0073..adcfc8cf 100644
--- a/src/components/reports/report-dpr.jsx
+++ b/src/components/reports/report-dpr.jsx
@@ -4,6 +4,7 @@ import Progress from "./Progress";
import { formatUTCToLocalTime } from "../../utils/dateUtils";
import { localToUtc } from "../../utils/appUtils";
import ReportsDonutCard, { ReportsCard } from "./ReportsDonutCard";
+import { SpinnerLoader } from "../common/Loader";
const ReportDPR = ({ project, date }) => {
const { data, isLoading, isError, error } = useProjectReportByProject(
@@ -12,88 +13,117 @@ const ReportDPR = ({ project, date }) => {
);
return (
<>
-
+
Project Status Reported - Generated at{" "}
{formatUTCToLocalTime(data?.date, true)}
{/* */}
diff --git a/src/pages/Home/SubscriptionPlans.jsx b/src/pages/Home/SubscriptionPlans.jsx
index 59ef4a7e..6f62eba3 100644
--- a/src/pages/Home/SubscriptionPlans.jsx
+++ b/src/pages/Home/SubscriptionPlans.jsx
@@ -9,7 +9,8 @@ const SubscriptionPlans = () => {
const [frequency, setFrequency] = useState(1);
const { data, isLoading, isError, error } = useSubscription(frequency);
const [loading, setLoading] = useState(false);
-
+ const [isOpen, setIsOpen] = useState(true);
+ console.log(data);
const frequencyLabel = (freq) => {
switch (freq) {
case 0:
@@ -35,9 +36,8 @@ const SubscriptionPlans = () => {
) : (
- data.map((plan) => (
+ data.map((plan, index) => (
{/* Header */}
@@ -102,24 +102,69 @@ const SubscriptionPlans = () => {
Features
-
+
+
{plan.features?.modules &&
- Object.values(plan.features.modules).map((mod) =>
- mod && mod.name ? (
-
-
- {mod.enabled ? (
-
- ) : (
-
- )}
- {mod.name}
-
- ) : null
- )}
-
+ Object.entries(plan.features.modules)
+ .sort(([, a], [, b]) => Number(b.enabled) - Number(a.enabled))
+ .map(([key, mod]) => {
+
+ if (!mod || !mod.name) return null;
+ const isFirst = index === 0;
+
+ return (
+
+
+
+
+
+
+
+ {mod.features?.length > 0 ? (
+
+ {mod.features.map((feat) => (
+ -
+
+ {feat.name}
+
+ ))}
+
+ ) : (
+
No additional features
+ )}
+
+
+
+
+ );
+ })}
+
{/* Button */}
@@ -138,6 +183,7 @@ const SubscriptionPlans = () => {
+
))
)}
diff --git a/src/pages/authentication/MainLoginWithOTPPage.jsx b/src/pages/authentication/MainLoginWithOTPPage.jsx
index 53b9fec7..872f39cf 100644
--- a/src/pages/authentication/MainLoginWithOTPPage.jsx
+++ b/src/pages/authentication/MainLoginWithOTPPage.jsx
@@ -1,5 +1,5 @@
-import React from 'react'
-import LoginWithOtp from './LoginWithOtp'
+import React from "react";
+import LoginWithOtp from "./LoginWithOtp";
const MainLoginWithOTPPage = () => {
return (
@@ -8,7 +8,7 @@ const MainLoginWithOTPPage = () => {

{
>
- )
-}
+ );
+};
-export default MainLoginWithOTPPage
\ No newline at end of file
+export default MainLoginWithOTPPage;
diff --git a/src/pages/authentication/MainResetPasswordPage.jsx b/src/pages/authentication/MainResetPasswordPage.jsx
index 36fd71e6..98d2bba9 100644
--- a/src/pages/authentication/MainResetPasswordPage.jsx
+++ b/src/pages/authentication/MainResetPasswordPage.jsx
@@ -1,14 +1,14 @@
-import React from 'react'
-import ResetPasswordPage from './ResetPassword'
+import React from "react";
+import ResetPasswordPage from "./ResetPassword";
const MainResetPasswordPage = () => {
return (
- <>
+ <>

{
>
- )
-}
+ );
+};
-export default MainResetPasswordPage
\ No newline at end of file
+export default MainResetPasswordPage;