<template>
    <div class="layout-px-spacing dash_1">

        <div class="row layout-top-spacing">
            <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="widget widget-recent-orders text-center">
                    <div class="text-center">
                        <img
                            src="@/assets/images/default/construcion.png"
                            class="navbar-logo"
                            alt="construccion"
                        />
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
    import '@/assets/sass/widgets/widgets.scss';
    import { useMeta } from '@/composables/use-meta';
    import { useAuthStore } from '@/store/AuthStore';
    import * as UserRepository from '@/repositories/UserRepository';
    import { onMounted } from 'vue';

    useMeta({ title: 'EGURROLA' });

    const store = useAuthStore();

    const obtener_user = async ()=>{
        try {
            const response = await UserRepository.getuser();
            return response;
        } catch (error) {
            console.log(error);
        }
    }

    onMounted(async ()=>{
        const token = window.localStorage.getItem("token");
        if(token){
            const response= await obtener_user();
            store.current_user.id=response.id;
            store.current_user.name=response.name;
            store.current_user.email=response.email;
            store.current_user.role=response.role;
        }
    });
</script>
