diff --git a/src/component/product/ProductProvision.jsx b/src/component/product/ProductProvision.jsx index f4adb06..fbabcc4 100644 --- a/src/component/product/ProductProvision.jsx +++ b/src/component/product/ProductProvision.jsx @@ -1,90 +1,110 @@ +import { useQuery } from "@tanstack/react-query"; +import queryKeys from "../../services/queryKeys"; +import { productProvision } from "../../services/services"; import getImage from "../../utils/getImage"; export default function ProductProvision(props){ const productTitle = props.productData?.title; const productDescription = props.productData?.description; + const productID = props?.productData?.product_id - return <> -
-
-
-
-
-

Creating - {productTitle}

+ const {data:provision, isFetching, isError, error} = useQuery({ + queryKey: queryKeys.myproduct_provision, + queryFn: () => productProvision(productID) + }) + + const provisionData = provision?.data?.provision + + return ( + <> + {isFetching ? + <> +
+
+

Loading...

+
+
+ + : isError ? +
+
+

{error.message}

+
+
+ : + <> +
+
+
+
+
+

Creating - {productTitle}

+
+
+
+
+
+
+
-
-
-
+
+
+
+ + +
+
+
+
+ +
+
+
+

Progress Information

+
+
+
+
+ + + + + + + + + + {provisionData?.url?.map(item => ( + + + + + + ))} + +
#Action
{item.id}{item.action}
+
+
-
-
-
-
-
-
+
+
+
+

Started creating your selection

+ Card image cap +
+

+ {productDescription} +

+
+
-
-
-
- -
- -
-
-
-

Progress Information

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
#Action
1Start Creation
2Update Access Routes
3Veryfing ...
-
-
-
-
- -
-
-

Started creating your selection

- Card image cap -
-

- {productDescription} -

-
-
- -
- - -
- + + } + + ) } \ No newline at end of file diff --git a/src/services/queryKeys.js b/src/services/queryKeys.js index 3a25f02..374cebe 100644 --- a/src/services/queryKeys.js +++ b/src/services/queryKeys.js @@ -3,7 +3,8 @@ const queryKeys = { topBar: ['top-bar'], recentAction: ['recent-action'], product: ['product-data'], - product_url: ['product_url'] + product_url: ['product_url'], + myproduct_provision: ['myproduct_provision'] } export default queryKeys \ No newline at end of file diff --git a/src/services/services.js b/src/services/services.js index f02e56b..c843224 100644 --- a/src/services/services.js +++ b/src/services/services.js @@ -106,6 +106,12 @@ export const recentActions = () => { return getAuxEnd(`/panel/account/actions`) } +// FUNCTION TO GET MY PRODUCT PROVISION DATA +export const productProvision = (productID) => { + const reqData = { product_id : productID} + return getAuxEnd(`/panel/myproduct/provision`,reqData) +} + // FUNCTION TO GET DASHBOARD PRODUCT DATA SECTION export const productData = () => { return getAuxEnd(`/panel/account/products`)