<template lang="pug">
    .supplier-card
        h2.supplier-name {{ item.name }}
        img.supplier-image(:src="!!item.imageMedium ? 'data:image/png;base64,' + item.imageMedium : 'base/static/src/img/avatar.png'")
</template>

<script>
    import { mapActions, mapGetters } from 'vuex'

    export default {
        props: {
            item: {
                type: Object,
                default: {}
            }
        }
    }
</script>

<style lang="sass">
    .supplier-card
        width: 130px
        height: 160px
        margin: 5px
        border: 1px solid #d3d3d3
        display: inline-block
        position: relative
        &.supplier-selected
            transition-duration: 300ms
            border-bottom: 3px solid #7c7bad
        &:hover
            cursor: pointer
        .supplier-name
            width: 100%
            height: 30px
            font-size: 9pt
            text-align: center
            margin-top: 10px
            position: absolute
            top: 0
        .supplier-image
            width: 80px
            height: 80px;
            margin: 0
            border: none
            position: absolute
            top: 50%
            left: 50%
            margin-right: -50%
            transform: translate(-50%, -50%)
</style>
