"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const components_1 = require("@bluebase/components");
const core_1 = require("@bluebase/core");
const react_1 = tslib_1.__importDefault(require("react"));
class SettingsPageItemMobile extends react_1.default.PureComponent {
    constructor() {
        super(...arguments);
        this.Component = (this.props.component && typeof this.props.component === 'string')
            ? core_1.getComponent(this.props.component)
            : this.props.component;
    }
    render() {
        const { description, descriptionStyle, title, titleStyle, } = this.props;
        const ItemComponent = this.Component;
        const styles = this.props.styles;
        const titleNode = !!title
            ? react_1.default.createElement(components_1.Body2, { style: [styles.titleStyles, titleStyle] }, title)
            : null;
        const descNode = !!description
            ? react_1.default.createElement(components_1.Caption, { style: [styles.descriptionStyles, descriptionStyle] }, description)
            : null;
        const componentNode = !!ItemComponent
            ? react_1.default.createElement(components_1.View, { style: styles.contentStyles },
                react_1.default.createElement(ItemComponent, null))
            : null;
        return (react_1.default.createElement(components_1.View, { style: styles.root },
            titleNode,
            componentNode,
            descNode));
    }
}
SettingsPageItemMobile.defaultProps = {
// isMobile: true,
};
SettingsPageItemMobile.defaultStyles = (theme) => ({
    contentStyles: {
    // backgroundColor: theme.palette.background.card,
    // borderBottomWidth: Platform.OS === 'ios' ? 1 : undefined,
    // borderColor: Platform.OS === 'ios' ? theme.palette.divider : undefined,
    // borderTopWidth: Platform.OS === 'ios' ? 1 : undefined,
    },
    descriptionStyles: {
        color: theme.palette.text.hint,
        paddingHorizontal: theme.spacing.unit * 2,
        paddingVertical: theme.spacing.unit * 2,
    },
    root: {
    // backgroundColor: Platform.OS === 'ios'
    // ? theme.palette.background.default
    // : theme.palette.background.card,
    },
    titleStyles: {
        color: theme.palette.primary.main,
        paddingHorizontal: theme.spacing.unit * 2,
        paddingVertical: theme.spacing.unit * 2,
    },
});
exports.SettingsPageItemMobile = SettingsPageItemMobile;
