import { StyleSheet, Text, View } from "react-native"; import React, { useEffect } from "react"; import { RootState, useAppDispatch } from "../../redux/store"; import { useSelector } from "react-redux"; import { captureAPI } from "../../apis/backendAPIConfig"; import Button from "../atoms/Button"; import { setActiveScreen } from "../../redux/UtilSlice"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; import { setDefaultAOPComplete } from "../../redux/AOPSlice"; const SuccessScreen = () => { const stepsUploaded = useSelector( (appState: RootState) => appState.AOP.stepsUploaded ); const steps = useSelector((appState: RootState) => appState.AOP.steps); const productId = useSelector( (appState: RootState) => appState.App.productID ); const dispatch = useAppDispatch(); const uploadAOP = async () => { try { // const response = await captureAPI.post("/capture", { // capture: { // productId, // steps, // }, // }); // console.log(response.status); // await captureAPI.put("/capture", { // productId, // }); dispatch(setDefaultAOPComplete(true)); } catch (error: any) { console.log(error.message); } }; useEffect(() => { if (stepsUploaded) { uploadAOP(); } }, [stepsUploaded]); return (