import React, {Dispatch, SetStateAction} from 'react'; import {Text, TouchableOpacity} from 'react-native'; import {CameraType} from 'react-native-camera'; import FlipIcon from '../../assets/icons/camera/flip.svg'; import {styles} from './styles'; interface FlipButtonProps { setCameraType: Dispatch>; cameraType: keyof CameraType; } /* * Toggles between back camera and front camera * Appears only when user has not taken a picture yet * Once user takes a picture, this button disappears to reveal the save button */ export const FlipButton: React.FC = ({ setCameraType, cameraType, }) => ( setCameraType(cameraType === 'front' ? 'back' : 'front')} style={styles.saveButton}> Flip ); export default FlipButton;