<script>
import Item from './item';
export default {
  functional: true,
  props: {
    months: Array,
    onClick: Function,
    onMouseEnter: { type: Function, default: () => {} }
  },
  render(h, ctx) {
    return (
      <table class={['hive-date-month', ctx.data.class]}>
        <tbody>
          {
            ctx.props.months.map((month, i) => (
              <tr key={i}>
                {
                  month.map((m, j) => (
                    h(Item, {
                      class: 'hive-date-month__item',
                      key: j,
                      props: {
                        onClick: ctx.props.onClick,
                        onMouseEnter: ctx.props.onMouseEnter,
                        ...m
                      }
                    })
                  ))
                }
              </tr>
            ))
          }
        </tbody>
      </table>
    );
  }
};
</script>
