<template>
    <v-card
        tile
        flat
        :height="height"
        :width="width"
        :color="color"
        :outlined="outlined"
    >
        <v-card-title>
            {{ __('Creare cont') }}
        </v-card-title>

        <v-card-subtitle>
            <span class="text-caption">
                {{ __('Completează datele solicitate pentru crearea contului') }}
            </span>
        </v-card-subtitle>

        <v-card-text>
            <register-form-input 
                class="mt-3"
                :app="app"
            />
        </v-card-text>

        <v-card-actions>
            <v-sheet 
                width="100%"
                class="text-center"
            >
                <cs-btn 
                    caption="Creează cont"
                    class="bg-dark-blue white--text"
                    :small="false"
                    :loading="app.forms.Register.processing"
                    :disabled="app.forms.Register.actionButtonDisabled"
                    :click="() => app.forms.Register.formprovider.Trigger()"
                />

            </v-sheet>
        </v-card-actions>

        <v-card-text>
            <v-sheet 
                width="100%"
                class="d-flex justify-center align-center"
            >
                <v-btn
                    plain
                    text
                    :href="$url + 'login'"
                    class="text-dark-blue text-no-transform"
                >
                    {{ __('Am deja cont. Conectează-mă') }}
                </v-btn>
            </v-sheet>
        </v-card-text>
    </v-card>
</template>

<script>
    export default {
        props: {
            app: {required: true},
            height: {default: null},
            width: {default: '100%'},
            color: {default: null},
            outlined: {default: false},
        },

        components: {
            RegisterFormInput: require('./Input/RegisterFormInput').default,
            CsBtn: require('@CsVueComp/buttons/CsBtn').default,
        },

        name: 'RegisterForm',
    }
</script>