import React from 'react'; import { View, Text, TouchableOpacity, StyleSheet, Alert, Share, } from 'react-native'; import { useLocalSearchParams, useRouter } from 'expo-router'; import { Ionicons } from '@expo/vector-icons'; import { SafeAreaView } from 'react-native-safe-area-context'; import QRCode from 'react-native-qrcode-svg'; import { useFilamentStore } from '@store/filamentStore'; import { colors, typography, spacing, radius } from '@shared/theme'; import { Button } from '@presentation/components/ui/Button'; /** * Tela de QR Code — 1CF-0 */ export default function QRCodeScreen(): React.ReactElement { const { id } = useLocalSearchParams<{ id: string }>(); const router = useRouter(); const { filaments } = useFilamentStore(); const filament = filaments.find((f) => f.id === id); const slug = filament ? `${filament.brand.toLowerCase()}-${(filament.model ?? '').toLowerCase()}-${filament.colorHex.replace('#', '').toLowerCase()}`.replace(/\s+/g, '-') : 'desconhecido'; const deepLink = `meowspool://filament/${id}`; async function handleShare(): Promise { try { await Share.share({ message: deepLink }); } catch { // cancelled } } async function handleCopyLink(): Promise { Alert.alert('Link', deepLink); } if (!filament) { return ( Filamento não encontrado ); } return ( {/* Header */} router.back()}> QR Code {/* Filament identity */} {filament.brand}{filament.model ? ` ${filament.model}` : ''} {filament.brand} · {filament.material} · {filament.colorHex} {/* QR Code area */} Aponte a câmera para escanear {deepLink} {/* Actions */}