import React from 'react' import { View, Text, Pressable, Platform, TextStyle } from 'react-native' import { RunnerObject, LibraryComponentManifest } from 'types' interface LibraryComponentErrorProps { object: RunnerObject onResetComponent: () => void manifest?: LibraryComponentManifest } const LibraryComponentError = ({ object, onResetComponent, manifest, }: LibraryComponentErrorProps) => { const { libraryName, componentName } = object.attributes const displayName = manifest?.displayName ?? `${libraryName}.${componentName}` const resetAction = Platform.OS === 'web' ? 'Click' : 'Tap' return ( Error rendering: {displayName} {resetAction} to reset ) } LibraryComponentError.defaultProps = { manifest: null, } export default LibraryComponentError const styles = { wrapper: { padding: 5, backgroundColor: '#fcc', borderColor: '#d00', borderWidth: 1, }, text: { color: '#d00', }, bold: { fontWeight: 'bold' as TextStyle['fontWeight'], }, }