import React, { PureComponent } from 'react';
import { Image, Text, View } from 'react-native';
import { TouchableHighlightLink } from './TouchableHighlightLink';
import { style as S } from '../styles/CategoryLine';
export class CategoryLine extends PureComponent {
    constructor() {
        super(...arguments);
        this.handlePress = () => {
            const { onPress } = this.props;
            if (onPress) {
                return onPress(this.props);
            }
        };
    }
    render() {
        const { renderAccessory, showAccessory, accessorySrc, accessoryStyle, href, image, showImage, imageStyle, style, title, titleStyle, underlayColor } = this.props;
        return (<TouchableHighlightLink style={[S.container, style]} underlayColor={underlayColor || '#eee'} onPress={this.handlePress} href={href}>
        <View style={S.rowInner}>
          {showImage && image && <Image source={image} style={imageStyle}/>}
          <Text style={[S.buttonText, titleStyle]}>
            {title}
          </Text>
          {showAccessory && accessorySrc &&
            <Image source={accessorySrc} style={accessoryStyle} resizeMode='contain'/>}
          {renderAccessory && renderAccessory()}
        </View>
      </TouchableHighlightLink>);
    }
}
CategoryLine.defaultProps = {
    showAccessory: true,
    showImage: true
};
//# sourceMappingURL=CategoryLine.js.map