<template>
    <div class="row">
        <div class="col b-a b-grey" :class="{'b-gray': !selected, 'b-primary': selected, 'bg-primary-lighter': selected}">
            <div class="row">
                <div class="col padding-20">
                    <div class="row align-items-center">
                        <div class="col-auto pointer align-items-center" @click="selectSupplier()">
                            <i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selected, 'fa-check-square': selected, 'text-primary':selected}" ></i>
                        </div>
                        <div class="col">
                            <h5 class="no-margin">{{ item.name }}</h5>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import componentHandler from "../../../general/mixins/componentHandler";

export default {
    props: {
        selectedSupplier: {
            type: Array,
            required: false,
        }  
    },
    data(){
        return {
            selected: false
        }
    },
    methods: {
        selectSupplier(){
            this.selected = !this.selected;
            this.$emit('input', this.item);
        }
    },
    mixins: [componentHandler]
};
</script>
