import cfxify from 'cfx.react.dom'
import { linkTo } from '@storybook/addon-links'
import {
  Row
  Col
  Card
  Divider
  Form
  Input
  Button
} from 'antd'

FormItem = Form.Item

CFX = cfxify {
  'div' 
  Row
  Col
  Card
  Form
  Input
  FormItem
  Divider
  Button
}

export default ({
  title
  CardContent
  HeaderDivider
  FooterDivider
}) =>
  {
    c_div
    c_Row
    c_Col
    c_Divider
    c_Form
    c_FormItem
    c_Input
    c_Button
  } = CFX

  c_div {}
  ,
    c_div.apply @, [
      style:
        minHeight: '50px'
    , 
      c_div
        style:
          fontSize: '16px'
          marginBottom: '30px'
          color: 'rgba(0, 0, 0, .85)'
          fontWeight: '500'
      , title
      (
        if HeaderDivider
        then [
          c_Divider {}
        ]
        else []
      )...
      
      (
        if CardContent
        then [
          CardContent
        ]
        else []
      )...
      
      (
        if FooterDivider
        then [
          c_Divider {}
        ]
        else []
      )...
    ]