<template>
    <div id="app">
        <Navbar/>
        <div class="container-fluid px-xl-5 mt-3">
            <div class="row" v-if="layout === 'table'">
                <div class="col-xl-8 offset-xl-2">
                    <Table
                        :columns="['uid', 'description', 'box', 'image']"
                        :items="loadedItems"
                        :keyName="'uid'"
                    />
                </div>
            </div>
            <Cards
                v-if="layout === 'cards'"
                :columns="['uid', 'description', 'box', 'image']"
                :items="loadedItems"
                :keyName="'uid'"
            />
        </div>
    </div>
</template>

<script>
import Table from '@/components/Table';
import Navbar from '@/components/Navbar';
import Cards from '@/components/Cards';
import { mapState } from 'vuex';

export default {
  name: 'app',
  components: { Navbar, Table, Cards },
  computed: mapState(['loadedItems', 'layout'])
};
</script>

<style>
    body, html, #app {
        background: #000;
    }
</style>
