
import {GetProps} from 'antd';
import React, {forwardRef} from 'react';
import styled from 'styled-components';

export const Layout = forwardRef<HTMLDivElement, ILayoutProps>((props, ref) => {

  return (
    <CustomLayoutStyle {...props} ref={ref} />
  )
});

interface ILayoutProps extends GetProps<JSX.IntrinsicElements['div']> {
  /** 子级元素撑满 */
  childDivBlock?: boolean;
}

const CustomLayoutStyle = styled.div<{childDivBlock?: boolean}>`
  ${(props) => props.childDivBlock ? `> div {width: 100%,padding: 10px}` : ''}
`;

export const componentType = 'container'