/*
 * File: index.js
 * Author: insane (luojie@doctorwork.com)
 * Last: insane (luojie@doctorwork.com>)
 * Date: 2018-04-Fr 10:57:59
 * Copyright 2018 - 2018 © Doctorwork
 */
import React from 'react';
import { getNavigationOptions, setHybridHeader } from './helper';
// import { updateTitle } from '../../utils/wechat';
import Async from '../Async';
const height = '40px';
export default (component, props) => {
    const { navigationOptions } = component;
    const isAsync = component.prototype.constructor === Async;
    return function Header() {
        const options = getNavigationOptions(navigationOptions, props);
        // hybrid 调用
        !isAsync && setHybridHeader(options);
        return (options && options.skip) || isAsync ? null : (
            <div className="app-header">
                <div className="app-status-bar" />
                <div className="app-header-content" height={height}>
                    {options.title}
                </div>
            </div>
        );
    };
};
