<template>
    <div class="row">
        <div class="col">
            <div class="row text-left" @keyup.enter="submitForm">
                <div class="col">
                    <error-message-component class="m-b-20" :error="error"></error-message-component>
                    <div class="row">
                        <div class="col">
                            <div class="row" >
                                <div class="col">
                                    <div class="row">
                                        <div class="col">
                                            <p class="bold fs-11 all-caps muted">Personal Information</p>
                                        </div>
                                    </div>
                                    <div class="row m-b-15">
                                        <div class="col p-r-5">
                                            <validation-wrapper-component :validator="$v.parameters.name">
                                                <label>Full Name</label>
                                                <input class="form-control" v-model="parameters.name">
                                            </validation-wrapper-component>
                                        </div>
                                        <div class="col p-l-5">
                                            <validation-wrapper-component :validator="$v.parameters.phone">
                                                <label>Phone</label>
                                                <input class="form-control" v-model="parameters.phone">
                                            </validation-wrapper-component>
                                        </div>
                                    </div>
                                    <div class="row m-b-15">
                                        <div class="col">
                                            <validation-wrapper-component :validator="$v.parameters.email">
                                                <label>Email</label>
                                                <input class="form-control" v-model="parameters.email">
                                            </validation-wrapper-component>
                                        </div>
                                    </div>
                                    <div class="row m-b-15">
                                        <div class="col p-r-5">
                                            <validation-wrapper-component :validator="$v.parameters.password">
                                                <label>Password</label>
                                                <input class="form-control" type="password" v-model="parameters.password">
                                            </validation-wrapper-component>
                                        </div>
                                        <div class="col p-l-5">
                                            <validation-wrapper-component :validator="$v.parameters.password_confirmation">
                                                <label>Password Confirmation</label>
                                                <input class="form-control" type="password" v-model="parameters.password_confirmation">
                                            </validation-wrapper-component>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-auto">
                                            <button type="button" class="btn btn-sm p-t-10 p-b-10 btn-default bg-master-lighter b-rad-none" @click="$store.dispatch('toggleSection', {name: 'registrationForm', status: false})">
                                                <div class="row align-items-center">
                                                    <div class="col-auto p-r-10">
                                                        <i class="fa fa-angle-left fs-16" style="margin-top: 1px;"></i>
                                                    </div>
                                                    <div class="col p-l-5">I already have an account</div>
                                                </div>
                                            </button>
                                        </div>
                                        <div class="col text-right">
                                            <button type="button" class="btn btn-sm btn-block p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none p-r-30" @click="submit(route('api.account.registration.invite.register'), 'post', section, false, false)"><i class="fa fa-check fs-18 m-r-10"></i>Complete Registration</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</template>
<script>
    import inviteRegistrationFormValidation from '../../../general/mixins/accounts/validation/inviteRegistrationFormValidation';
    export default {
        props: {
            id: {
                required: true,
                type: Number
            }
        },
        data() {
            return {
                error: '',
                parameters : {
                    company_id: this.id,
                    name: '',
                    email: '',
                    phone: '',
                    password: '',
                    password_confirmation: '',
                }
            }
        },
        mixins: [inviteRegistrationFormValidation]
    }
</script>
