CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { colors } from '../theme/colors';
interface ErrorBannerProps {
message: string;
onRetry?: () => void;
}
export function ErrorBanner({ message, onRetry }: ErrorBannerProps): React.ReactElement {
return (
<View style={styles.container}>
<Text style={styles.icon}>⚠</Text>
<Text style={styles.message}>{message}</Text>
{onRetry !== undefined && (
<TouchableOpacity style={styles.retryButton} onPress={onRetry} activeOpacity={0.7}>
<Text style={styles.retryText}>Retry</Text>
</TouchableOpacity>
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
margin: 16,
padding: 16,
backgroundColor: colors.bgSecondary,
borderRadius: 8,
borderWidth: 1,
borderColor: colors.accentRed,
alignItems: 'center',
gap: 8,
},
icon: {
fontSize: 20,
color: colors.accentRed,
},
message: {
fontSize: 14,
color: colors.text,
textAlign: 'center',
lineHeight: 20,
},
retryButton: {
marginTop: 4,
paddingHorizontal: 20,
paddingVertical: 8,
backgroundColor: colors.bgTertiary,
borderRadius: 6,
borderWidth: 1,
borderColor: colors.border,
},
retryText: {
fontSize: 14,
fontWeight: '500',
color: colors.textLink,
},
});
|