import React from 'react';
import { CoverLayout } from '@sensoro/layout';
import { APP_TYPE } from '../../types';
import AppBanner from '../app-banner';
import styles from './index.less';

export interface AppLayoutProps {
  appType: APP_TYPE;
  banner?: React.ReactNode;
  statistics?: any[];
}
const AppLayout: React.FC<AppLayoutProps> = props => {
  const { banner, appType, children, statistics = [] } = props;
  const realBanner = banner ? (
    banner
  ) : (
    <AppBanner appType={appType} statistics={statistics} />
  );
  return (
    <CoverLayout disableBreadcrumb={true} align={'full'}>
      {realBanner}
      <div className={styles.bannerWrapper}>{children}</div>
    </CoverLayout>
  );
};

export default AppLayout;
