This repository has been archived on 2021-07-29. You can view files and clone it, but cannot push or open issues or pull requests.
find_coach/src/pages/coaches/CoachesList.vue

55 lines
1.1 KiB
Vue

<template>
<section>
Filter
</section>
<base-card>
<section>
<div class="controls">
<base-button mode="outline">Refresh</base-button>
<base-button link to="/register">Register as Coach</base-button>
</div>
<ul v-if="hasCoaches">
<coach-item
v-for="coach in filteredCoaches"
:key="coach.id"
:id="coach.id"
:firstName="coach.firstName"
:lastName="coach.lastName"
:areas="coach.areas"
:rate="coach.hourlyRate"
></coach-item>
</ul>
<h3 v-else>No coaches found.</h3>
</section>
</base-card>
</template>
<script>
import CoachItem from '../../components/coaches/CoachItem.vue';
export default {
components: { CoachItem },
computed: {
filteredCoaches() {
return this.$store.getters['coaches/coaches'];
},
hasCoaches() {
return this.$store.getters['coaches/hasCoaches'];
}
}
};
</script>
<style scoped>
ul {
list-style: none;
margin: 0;
padding: 0;
}
.controls {
display: flex;
justify-content: space-between;
}
</style>