<template>
    <header>
        <div class="header_style">
            <div class="container">
                <div class="row flex-column-reverse flex-lg-row">
                    <div class="col-xl-8 col-lg-8 text-center text-lg-right">
                        <button v-if="!user" data-toggle="modal" data-target="#loginCheck"><i class="o-icon o-single-01"></i>ورود / عضویت</button>
                        <a class="myFabrikaBtn" href="/myFabrika" v-else><i class="o-icon o-single-01"></i>فابریکای من</a>
                        <nav class="navbar navbar-expand-lg justify-content-center justify-content-lg-start mt-3 mt-lg-0">
                            <button class="navbar-toggler" type="button" data-toggle="collapse"
                                    data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false"
                                    aria-label="Toggle navigation">
                                <i class="o-icon o-menu-34 ml-0"></i>
                            </button>

                            <div class="collapse navbar-collapse" id="navbarNavDropdown">
                                <ul class="navbar-nav align-items-center">
                                    <li class="nav-item">
                                        <a class="nav-link" href="/"><i class="o-icon o-home-51 d-none d-lg-block"></i> صفحه اصلی</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="/list">آخرین آگهی ها</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="/shopList">لیست فروشگاه ها</a>
                                    </li>
                                    <li class="nav-item" v-if="user">
                                        <a class="nav-link" href="/myAds">آگهی های من</a>
                                    </li>
                                </ul>
                            </div>
                        </nav>
                    </div>
                    <div class="col-xl-4 col-lg-4">
                        <div class="row flex-column-reverse flex-lg-row">
                            <div class="col-lg-8">
                                <div class="link_left justify-content-center justify-content-lg-end my-3 my-lg-0">
                                    <a href="/createAd" v-if="user">ثبت آگهی</a>
                                    <a data-toggle="modal" data-target="#loginCheck" v-else>ثبت آگهی</a>
                                    <a href="#register_expert" data-toggle="modal" v-if="user && !user.isExpert">ثبت نام کارشناس</a>
                                </div>
                            </div>
                            <div class="col-lg-4 text-center text-lg-right">
                                <img src="/uploads/img/logo.png">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>
</template>
<script>
    export default {
        components: {
        },
        data() {
            return {
                user:null
            }

        },
        beforeMount(){

        },
        watch:{

        },
        mounted() {
            axios.get('/core/user').then(res=>{
                this.user = res.data.data
            })
        },
        methods:{


        },
    }
</script>
