<template>
  <div>
    <section class="section-property section-t8">
      <div class="container">
        <div class="row">
          <div class="col-md-12">
            <div class="title-wrap d-flex justify-content-between">
              <div class="title-box">
                <h2 class="title-a">Latest Properties</h2>
              </div>
            </div>
          </div>
        </div>
        <propertyCard
          v-if="latestProperties.length > 0"
          name="propertyholder"
          :properties="latestProperties"
          :showSort="false"
        />
      </div>
    </section>
  </div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import propertyCard from '../property/propertyCard.vue';

export default {
  components: {
    propertyCard,
  },
  computed: {
    ...mapState('property', ['latestProperties']),
  },
  methods: {
    ...mapActions('property', ['searchLatestProperties']),
  },
  mounted() {
    this.searchLatestProperties();
  },
};
</script>
