+
+
+
+ Select Task
-
- {
- taskType == 'select' ?
- familyTask?.data?.length ?
- familyTask?.data?.map((item, index)=>(
-
+ {/* Task Type === select */}
+ {taskType == "select" && (
+
+ {familyTask?.data?.length ? (
+ familyTask?.data?.map((item, index) => (
+
handleActiveTask(item.job_uid, item)}
+ >
+
+ handleActiveTask(item.job_uid, item)
+ }
+ className="w-[15px] h-[15px] cursor-pointer"
/>
-
{item?.title}
+
+ {item?.title}
+
- ))
- :
-
No Task found!
- :
-
SPACE FOR NEW TASK
- }
+ ))
+ ) : (
+
+ No Task found!
+
+ )}
-
+ )}
+ {taskType !== "select" && (
+
+
+
+ )}
+
- {familyTask?.data?.length > 0 ?
-
-
-
{activeTask?.data?.title}
-
-
-
-
-
-
-
{PriceFormatter(activeTask?.data?.price*0.01, activeTask?.data?.currency, activeTask?.data?.curreny_code)}
-
+ {/*Right Hand Side for details && Task Type === select */}
+ {taskType == "select" && (
+ <>
+ {familyTask?.data?.length > 0 ? (
+
+
+
+ {activeTask?.data?.title}
+
+
+
+
+
+
+
+
+ {PriceFormatter(
+ activeTask?.data?.price * 0.01,
+ activeTask?.data?.currency,
+ activeTask?.data?.curreny_code
+ )}
+
+
-
-
-
{`${activeTask?.data?.timeline_days} day(s)`}
+
+
+
{`${activeTask?.data?.timeline_days} day(s)`}
+
+
+
+
+
+
+
+
+
+
+
+ ) : (
+ <>>
+ )}
+ >
+ )}
+
-
-
-
-
-
-
-
- {/*
{}
*/}
-
+ {/* BTN */}
+
+ {/* error or success display */}
+ {requestStatus.message != "" &&
+ (!requestStatus.status ? (
+
+ {requestStatus.message}
-
- :
- <>>
- }
-
-
- {/* BTN */}
-
- {/* error or success display */}
- {requestStatus.message != "" &&
- (!requestStatus.status ? (
+ ) : (
+ requestStatus.status && (
{requestStatus.message}
- ) : (
- requestStatus.status && (
-
- {requestStatus.message}
-
- )
- ))}
- {/* End of error or success display */}
-
-
- {requestStatus.loading ?
-
- :
+ )
+ ))}
+ {/* End of error or success display */}
+
+
+ {requestStatus.loading ? (
+
+ ) : (
- }
-
+ )}
- >
- }
-
-
+
+ >
+ )}
+
+
>
- )
+ );
}
-export default AssignTaskPopout
\ No newline at end of file
+export default AssignTaskPopout;
diff --git a/src/components/FamilyAcc/FamilyPopout/forms/NewTasks.jsx b/src/components/FamilyAcc/FamilyPopout/forms/NewTasks.jsx
new file mode 100644
index 0000000..a83ac43
--- /dev/null
+++ b/src/components/FamilyAcc/FamilyPopout/forms/NewTasks.jsx
@@ -0,0 +1,228 @@
+import React, { useEffect, useState } from "react";
+import usersService from "../../../../services/UsersService";
+import InputCom from "../../../Helpers/Inputs/InputCom";
+
+export default function NewTasks({ onChange }) {
+ let [currency, setCurrency] = useState({
+ loading: true,
+ status: false,
+ data: null,
+ });
+
+ const [formState, setFormState] = useState({
+ // Initialize form state with desired fields
+ country: "",
+ price: "",
+ title: "",
+ description: "",
+ job_detail: "",
+ timeline_days: "",
+ category: [],
+ });
+
+ const ApiCall = new usersService();
+
+ // FUNCTION TO GET Currency
+ const getUserCurrency = () => {
+ setCurrency((prev) => ({ ...prev, loading: true }));
+ ApiCall.getUserWallets()
+ .then((res) => {
+ if (res.data.internal_return < 0) {
+ setCurrency({ loading: false, status: true, data: [] });
+ return;
+ }
+
+ setCurrency({
+ loading: false,
+ status: true,
+ data: res.data.result_list,
+ });
+ })
+ .catch((err) => {
+ setCurrency({ loading: false, status: false, data: [] });
+ });
+ };
+
+ const handleInputChange = (event) => {
+ const { name, value } = event.target;
+ setFormState((prevState) => ({
+ ...prevState,
+ [name]: value,
+ }));
+ onChange(formState); // Pass the form data to the parent on every change
+ };
+
+ useEffect(() => {
+ getUserCurrency();
+ }, []);
+
+ return (
+
+ );
+}
+
+const publicArray = [
+ { duration: 1, name: "1 day" },
+ { duration: 2, name: "2 days" },
+ { duration: 3, name: "3 days" },
+ { duration: 4, name: "4 days" },
+ { duration: 5, name: "5 days" },
+ { duration: 6, name: "6 days" },
+ { duration: 7, name: "1 week" },
+ { duration: 14, name: "2 weeks" },
+ { duration: 21, name: "3 weeks" },
+ { duration: 28, name: "4 weeks" },
+];
diff --git a/src/components/FamilyAcc/FamilyPopout/forms/index.js b/src/components/FamilyAcc/FamilyPopout/forms/index.js
new file mode 100644
index 0000000..bb7150f
--- /dev/null
+++ b/src/components/FamilyAcc/FamilyPopout/forms/index.js
@@ -0,0 +1,3 @@
+import NewTasks from "./NewTasks";
+
+export {NewTasks}
\ No newline at end of file