<template lang="pug">
    .purchase-step
        .products-selector
            searcher(:items='products' :keys="['name', 'displayName']")
            card-grid(:items='visibleProducts' canAdd)
        cart
</template>

<script>
    import Searcher from '@/components/common/Searcher'
    import CardGrid from '@/components/common/CardGrid'
    import Cart from '@/components/product/Cart'

    import { mapGetters, mapActions } from 'vuex'

    export default {
        components: {
            Searcher,
            CardGrid,
            Cart
        },
        computed: mapGetters([
            'products',
            'visibleProducts'
        ])
    }
</script>

<style lang="sass">
    .purchase-step
        .products-selector
            width: calc(100% - 300px)
            height: 100%
            padding-right: 5px
            display: inline-block
        .cart-viewer
            width: 300px
            height: 100%
            border-left: 1px solid #d3d3d3
            padding-left: 10px
            display: inline-block
            vertical-align: top
</style>
