<template>
    <ul class="nav-items">
        <li class="nav-item">
            <router-link :to="{ name: 'blog' }">Blog</router-link>
        </li>
        <li class="nav-item">
            <router-link :to="{ name: 'snippets' }">Snippets</router-link>
        </li>
        <li class="nav-item">
            <router-link :to="{ name: 'contact' }">Contact</router-link>
        </li>
        <li class="nav-item" v-if="admin">
            <a href="/admin">Admin</a>
        </li>
    </ul>
</template>

<script>
export default {
    data() {
        return {
            admin: false,
        };
    },
    mounted() {
        axios.get('/api/auth')
            .then(res => {
                this.admin = res.data.status;
            });
    }
}
</script>
