1/** 2 * Copyright (c) 650 Industries. 3 * Copyright (c) Meta Platforms, Inc. and affiliates. 4 * 5 * This source code is licensed under the MIT license found in the 6 * LICENSE file in the root directory of this source tree. 7 */ 8import React from 'react'; 9import { StyleSheet, Text, View } from 'react-native'; 10 11import * as LogBoxStyle from '../UI/LogBoxStyle'; 12 13type Props = { 14 heading: string; 15 children: React.ReactNode; 16 action?: any; 17}; 18 19export function LogBoxInspectorSection(props: Props) { 20 return ( 21 <View style={styles.section}> 22 <View style={styles.heading}> 23 <Text style={styles.headingText}>{props.heading}</Text> 24 {props.action} 25 </View> 26 <View style={styles.body}>{props.children}</View> 27 </View> 28 ); 29} 30 31const styles = StyleSheet.create({ 32 section: { 33 marginTop: 15, 34 }, 35 heading: { 36 alignItems: 'center', 37 flexDirection: 'row', 38 paddingHorizontal: 12, 39 marginBottom: 10, 40 }, 41 headingText: { 42 color: LogBoxStyle.getTextColor(1), 43 flex: 1, 44 fontSize: 18, 45 fontWeight: '600', 46 includeFontPadding: false, 47 lineHeight: 20, 48 }, 49 body: { 50 paddingBottom: 10, 51 }, 52}); 53