<template>
  <div class="box">
    <ItemInput
      @addItem="onAddItem"
      :source="inventory"
    ></ItemInput>
    <div class="field is-horizontal">
      <div class="field-label"><label class="label">ou</label></div>
      <div class="field-body">
        <div class="field">
            <div class="control">
                <button class="button is-primary">Depuis une liste</button>
            </div>
        </div>
      </div>
    </div>
    <button class="button is-danger" @click="$emit('confirmAction')">Finaliser</button>
  </div>
</template>

<script>
    import ItemInput from './ItemInput.vue'

    export default {
        props: ["inventory"],
        components: { ItemInput },
        data () { return {}; },
        methods: {
            onAddItem (item) {
                this.$emit('addItem', item);
            },
        }

    }
</script>
