<template>
    <v-card
        tile
        flat
        :height="height"
        :width="app.width"
        class="d-flex"
    >
        <folders-side 
            v-if="uploader.hasFolderTree"
            :uploader="uploader"
            :width="folderswidth"
            :height="height"
        />

        <files-side 
            :uploader="uploader"
            :width="'calc(100% - ' + folderswidth + 'px)'"
            :height="height"
        />
    </v-card>
</template>

<script>
    export default {
        props: {
            uploader: {required: true},
            height: {default: null},

            folderssidewidth: {default: 340},
        },

        computed: {
            app() {
                return this.uploader.app;
            },

            folderswidth() {
                if(this.uploader.hasFolderTree)
                {
                    return this.folderssidewidth;
                }
                return 0;
            },

            customer() {
                return this.uploader.customer;
            },
        },

        created() {
            this.uploader.Refreshfolders();
        },

        name: 'FoldersPanel',
    }
</script>