Files
Shoppy/src/components/scan/ScanErrorModal.js
T
Fretux 7f380fef20
Android Release Build / build-android (push) Failing after 7m11s
add features for manual product editing
2026-10-28 00:13:02 +01:00

49 lines
1.4 KiB
JavaScript

import { Modal, StyleSheet, Text, View } from 'react-native';
import PrimaryButton from '../PrimaryButton';
import SecondaryButton from '../SecondaryButton';
import { colors } from '../../utils/constants';
export default function ScanErrorModal({ visible, message, onRetry, onManualSearch, onClose, onCreateLocalProduct }) {
return (
<Modal animationType="fade" onRequestClose={onClose} transparent visible={visible}>
<View style={styles.backdrop}>
<View style={styles.modal}>
<Text style={styles.title}>Scan nicht erfolgreich</Text>
<Text style={styles.message}>{message}</Text>
<PrimaryButton label="Erneut scannen" onPress={onRetry} />
<SecondaryButton label="Manuell eingeben" onPress={onManualSearch} />
{onCreateLocalProduct ? <SecondaryButton label="Produkt lokal erfassen" onPress={onCreateLocalProduct} /> : null}
</View>
</View>
</Modal>
);
}
const styles = StyleSheet.create({
backdrop: {
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.45)',
flex: 1,
justifyContent: 'center',
padding: 24
},
modal: {
backgroundColor: colors.surface,
borderRadius: 20,
gap: 14,
padding: 20,
width: '100%'
},
title: {
color: colors.text,
fontSize: 20,
fontWeight: '800'
},
message: {
color: colors.muted,
fontSize: 15,
lineHeight: 21
}
});