import React, { useState } from 'react'; import { View, Text, Button } from 'react-native'; import BarcodeScanner from '../components/BarcodeScanner'; const ProductScannerScreen = ({ navigation }) => { const [scannedProduct, setScannedProduct] = useState(null); const handleScan = (product) => setScannedProduct(product); const handleAddToCart = () => { // Add product to cart and navigate to cart screen navigation.navigate('Cart'); }; return ( {scannedProduct && ( {scannedProduct.name} {scannedProduct.price}