<script>
// @flow
/** @jsx h */

export default {
  name: 'TaoRow',
  functional: true,
  props: {
    alignCenter: {
      type: Boolean,
      default: false,
    },
    tag: {
      type: String,
      default: 'section',
    },
  },
  render(h: Function, { props, data, children }: Functional) {
    const CustomTag = props.tag;

    return (
      <CustomTag
        {...data}
        class={{
          tao__row: true,
          'tao__row-center': props.alignCenter,
        }}>
        { children }
      </CustomTag>
    );
  },
};
</script>
