<?php
/*
* Plugin-Name: Product Designer App
* Plugin-URI: https://productdesignerapp.com
* Author: productdesignerapp
* Page: Arts
*/

if (!defined('ABSPATH'))
{
    exit;
}
?>
<template v-if="modal.type == 'folder'">
    <div class="modal-body">
        <div class="mb-3">
            <div class="row">
                <div class="col-12 col-lg-7 col-xl-8">
                    <label class="form-label">{{ langs.art.folder_name }} <span class="text-danger">*</span></label>
                    <input type="text" class="form-control" v-model="modal.data.title[modal.langCode]" :placeholder="langs.art.folder_name_desc">
                </div>
                <div class="col-12 col-lg-5 col-xl-4" v-show="Object.keys(listLang.list).length > 1">
                    <label class="form-label">{{ langs.art.languages }} <span class="text-danger">*</span></label>
                    <select class="form-select mw-100" v-model="modal.langCode">
                        <option v-for="(lang, lid) in listLang.list" :key="lid" :value="lid">{{ lang }}</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="mb-0">
            <div class="row">
                <div class="col-6 col-lg-7 col-xl-8">
                    <label class="form-label">{{ langs.art.thumbnail }}</label>
                    <input class="form-control" type="file" accept="image/png, image/jpg, image/jpeg" @change="changeThumbFile($event)">
                </div>
                <div class="col-6 col-lg-5 col-xl-4">
                    <img class="img-thumbnail pdapp-mw100" :src="showImg(modal.data.thumb, 'folder')">
                </div>
            </div>
        </div>
    </div>
    
    <div class="modal-footer">
        <button type="button" class="btn btn-light" @click="modal.show = false">{{ langs.cancel }}</button>
        <button type="button" class="btn btn-primary" :disabled="modal.saving || (modal.type == 'art' && modal.data.thumb == '') || modal.data.title[modal.langCode] == ''" @click="saveModal()">
            <span class="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true" v-if="modal.saving"></span>
            {{ modal.data.id == '' ? langs.save : langs.update }}
        </button>
    </div>
</template>