import { useCallback } from "react"; import { Pressable, Text, View, Platform } from "react-native"; import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { QrCode, Link2, ClipboardPaste } from "lucide-react-native"; import { AdaptiveModalSheet } from "./adaptive-modal-sheet"; const styles = StyleSheet.create((theme) => ({ option: { flexDirection: "row", alignItems: "center", gap: theme.spacing[4], padding: theme.spacing[4], borderRadius: theme.borderRadius.xl, backgroundColor: theme.colors.surface2, borderWidth: 1, borderColor: theme.colors.border, }, optionText: { color: theme.colors.foreground, fontSize: theme.fontSize.base, fontWeight: theme.fontWeight.semibold, }, optionSubtext: { color: theme.colors.foregroundMuted, fontSize: theme.fontSize.sm, marginTop: theme.spacing[1], }, optionBody: { flex: 1, }, })); export interface AddHostMethodModalProps { visible: boolean; onClose: () => void; onDirectConnection: () => void; onScanQr: () => void; onPasteLink: () => void; } export function AddHostMethodModal({ visible, onClose, onDirectConnection, onScanQr, onPasteLink, }: AddHostMethodModalProps) { const { theme } = useUnistyles(); const handleDirect = useCallback(() => { onClose(); onDirectConnection(); }, [onClose, onDirectConnection]); const handleScan = useCallback(() => { onClose(); onScanQr(); }, [onClose, onScanQr]); const handlePaste = useCallback(() => { onClose(); onPasteLink(); }, [onClose, onPasteLink]); return ( Direct connection Enter a host and port. {Platform.OS !== "web" ? ( Scan QR code Use your camera to pair. ) : null} Paste pairing link Works without a camera. ); }