import { Image, StyleSheet, Text, View } from "react-native"; import React, { useState } from "react"; import { useSelector } from "react-redux"; import { RootState, useAppDispatch } from "../../redux/store"; import { setAOPIncrement, setShowPreview } from "../../redux/AOPSlice"; import Video from "react-native-video"; import Button from "../atoms/Button"; import { slotDataUpload } from "../../redux/AOPSlice"; import Interior360 from "../atoms/Interior360"; type Props = {}; const PreviewModal = () => { const dispatch = useAppDispatch(); const showPreview = useSelector((state: RootState) => state.AOP.showPreview); const activeSlotIndex = useSelector( (state: RootState) => state.AOP.activeSlotIndex ); const activeStepIndex = useSelector( (state: RootState) => state.AOP.activeStepIndex ); const activeSlotItemIndex = useSelector( (state: RootState) => state.AOP.activeSlotItemIndex ); const activeSlotItemActionIndex = useSelector( (state: RootState) => state.AOP.activeSlotItemActionIndex ); const steps = useSelector((state: RootState) => state.AOP.steps); const slotList = steps.length > 0 ? steps[activeStepIndex].slots : []; const { orientation } = useSelector((appState: RootState) => appState.Util); const getCurrentAction = () => { if (slotList.length > 0) { const slot = slotList[activeSlotIndex]; if (slot.slotItems && slot.slotItems.length > 0) { if (activeSlotItemActionIndex >= 0) return slot.slotItems[activeSlotItemIndex].availableActions[ activeSlotItemActionIndex ]; else return undefined; } else { return slotList[activeSlotIndex].action; } } else return undefined; }; const currentAction = getCurrentAction(); return ( {currentAction && currentAction.sourceType === "Ricoh" ? ( ) : currentAction?.storagePath?.split("/").pop()?.split(".").pop() === "jpeg" ? ( ) : (