import React from 'react'; import { StyleSheet, View, ViewProps } from 'react-native'; import { Text, TextElement, TextProps } from '@ui-kitten/components'; import { ShowcaseItem, ShowcaseItemProps } from './showcase-item.component'; import { ComponentShowcaseItem, ComponentShowcaseSection } from '../model/showcase.model'; export interface ShowcaseSectionProps extends ViewProps { section: ComponentShowcaseSection; renderItem: (props: any) => React.ReactElement; } export const ShowcaseSection = (props: ShowcaseSectionProps): React.ReactElement => { const { style, section, renderItem } = props; const renderShowcaseItem = (item: ComponentShowcaseItem, index: number): React.ReactElement => ( ); const renderTitleElement = (): TextElement => ( {section.title} ); const titleElement: React.ReactElement = section.title && renderTitleElement(); return ( {titleElement} {section.items.map(renderShowcaseItem)} ); }; const styles = StyleSheet.create({ container: {}, titleLabel: { marginVertical: 8, fontSize: 20, lineHeight: 28, textAlign: 'left', }, item: { marginVertical: 8, }, });