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 | import React from 'react';
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
import { colors } from '../theme/colors';
import { fontSizes } from '../theme/typography';
interface Props {
message: string;
onRetry?: () => void;
}
export function ErrorState({ message, onRetry }: Props) {
return (
<View style={styles.container}>
<Text style={styles.icon}>!</Text>
<Text style={styles.message}>{message}</Text>
{onRetry && (
<TouchableOpacity style={styles.retryBtn} onPress={onRetry} activeOpacity={0.75}>
<Text style={styles.retryText}>Retry</Text>
</TouchableOpacity>
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 32,
backgroundColor: colors.bg,
},
icon: {
fontSize: 40,
color: colors.red,
marginBottom: 12,
fontWeight: '700',
},
message: {
color: colors.textMuted,
fontSize: fontSizes.base,
textAlign: 'center',
lineHeight: 22,
marginBottom: 20,
},
retryBtn: {
backgroundColor: colors.accentDim,
borderRadius: 8,
paddingHorizontal: 20,
paddingVertical: 10,
},
retryText: {
color: colors.accent,
fontSize: fontSizes.base,
fontWeight: '600',
},
});
|