<template>
    <a :href="'/single/'+ad.id">
        <div class="back_post">
            <div class="instant" v-if="ad.priority != 'normal'">{{ad.priority=='immediate'?'فوری':ad.priority=='special'?'ویزه':ad.priority=='immediate-special'?'ویژه و فوری':''}}</div>
            <div class="slider_post">
                <div class="states_back">
                    <div class="shadow"></div>
                    <img :src="ad.attachmentsImage.length?'/files?uid='+ad.attachmentsImage[0].uid+'&width=350&height=180':'/images/default-image.png'">
                    <span v-if="ad.price">{{ad.price|priceFormat}} تومان</span>
                    <span v-else>تماس بگیرید</span>
                </div>
            </div>
            <div class="details">
                <h3>{{ad.title}}</h3>
                <span>آگهی دهنده: {{ad.user.fname}} {{ad.user.lname}}</span>
                <span>تاریخ: {{ad.created_at|persian_date}}</span>
                <div class="icons">
                    <span>{{ad.attachmentsImage.length}} <i class="o-icon o-camera-18"></i></span>
                </div>
            </div>
        </div>
    </a>
</template>

<script>
    export default {
        data() {
            return {

            }
        },
        props:['ad'],
        watch:{

        },
        mounted() {

        },
        methods:{

        },
    }
</script>
