import React, { useState } from 'react'; import { Modal, View, TextInput, TouchableOpacity, Text, StyleSheet, Alert, } from 'react-native'; interface PairingDialogProps { visible: boolean; onSubmit: (code: string) => void; onCancel: () => void; } export const PairingDialog: React.FC = ({ visible, onSubmit, onCancel, }) => { const [code, setCode] = useState(''); const handleSubmit = () => { if (code.trim().length === 0) { Alert.alert('Error', 'Please enter the pairing code'); return; } onSubmit(code); setCode(''); }; const handleCancel = () => { setCode(''); onCancel(); }; return ( Enter Pairing Code Please enter the pairing code shown on your TV screen Cancel Submit ); }; const styles = StyleSheet.create({ modalOverlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.5)', justifyContent: 'center', alignItems: 'center', }, modalContent: { backgroundColor: 'white', borderRadius: 8, padding: 20, width: '80%', maxWidth: 400, }, title: { fontSize: 18, fontWeight: 'bold', marginBottom: 8, textAlign: 'center', }, subtitle: { fontSize: 14, color: '#666', marginBottom: 20, textAlign: 'center', }, input: { borderWidth: 1, borderColor: '#ccc', borderRadius: 4, padding: 10, marginBottom: 20, fontSize: 16, }, buttonContainer: { flexDirection: 'row', justifyContent: 'space-between', }, button: { flex: 1, padding: 12, borderRadius: 4, marginHorizontal: 8, }, cancelButton: { backgroundColor: '#666', }, submitButton: { backgroundColor: '#007AFF', }, buttonText: { color: 'white', textAlign: 'center', fontSize: 16, fontWeight: '500', }, });