import React, {FC, ReactNode} from 'react';
import {ViewStyle} from 'react-native';

import Header from '@components/Header';
import {IProps as HeaderProps} from '@components/Header/types';
import {StyledContainer, Wrapper} from '@styles/components/container';

interface IProps {
  header?: HeaderProps;
  children?: ReactNode;
  containerStyle?: ViewStyle;
}

const Container: FC<IProps> = ({header, children, containerStyle}) => (
  <StyledContainer style={containerStyle}>
    <Header {...header} />
    {!!children && <Wrapper edges={['bottom']}>{children}</Wrapper>}
  </StyledContainer>
);

export default Container;
