InfoItem.tsx 654 B

123456789101112131415161718192021222324252627
  1. import { FC, ReactNode } from 'react';
  2. import { View, Text } from 'react-native';
  3. import { styles } from './styles';
  4. export const InfoItem: FC<{
  5. title: string;
  6. inline?: boolean;
  7. children: ReactNode;
  8. showMore?: boolean;
  9. }> = ({ title, inline, children, showMore }) => (
  10. <View>
  11. <Text style={[styles.headerText, { flex: 0 }]}>{title}</Text>
  12. <View
  13. style={[
  14. {
  15. display: 'flex',
  16. flexDirection: inline ? 'row' : 'column',
  17. justifyContent: 'space-evenly',
  18. marginTop: 10
  19. },
  20. showMore ? { flexWrap: 'wrap', gap: 8 } : {}
  21. ]}
  22. >
  23. {children}
  24. </View>
  25. </View>
  26. );