"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const components_1 = require("@bluebase/components");
const react_native_1 = require("react-native");
const core_1 = require("@bluebase/core");
const react_1 = tslib_1.__importDefault(require("react"));
const SettingsPageItemDesktop = core_1.getComponent('SettingsPageItemDesktop');
class SettingsPageDesktop extends react_1.default.PureComponent {
    render() {
        const items = this.props.items || [];
        const styles = this.props.styles;
        const navigationOptions = core_1.resolveThunk(this.props.navigationOptions || {});
        const title = navigationOptions.title || navigationOptions.headerTitle;
        return (react_1.default.createElement(react_native_1.ScrollView, null,
            react_1.default.createElement(components_1.View, { style: styles.root },
                title && (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(components_1.H6, { style: styles.title }, title),
                    react_1.default.createElement(components_1.Divider, null))),
                items.map((item, index) => (react_1.default.createElement(react_1.default.Fragment, { key: item.name },
                    react_1.default.createElement(SettingsPageItemDesktop, Object.assign({}, item)),
                    index < items.length - 1 && react_1.default.createElement(components_1.Divider, null)))))));
    }
}
SettingsPageDesktop.defaultProps = {};
SettingsPageDesktop.defaultStyles = (theme) => ({
    root: {
        backgroundColor: theme.palette.background.default,
        flex: 1,
    },
    title: {
        padding: theme.spacing.unit * 2,
    },
});
exports.SettingsPageDesktop = SettingsPageDesktop;
