You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
929 B

  1. <template>
  2. <v-tooltip bottom>
  3. <template v-slot:activator="{ on }">
  4. <v-btn
  5. v-on="on"
  6. @click="approveDocument"
  7. :disabled="disabled"
  8. class="text-capitalize ps-1 pe-1"
  9. min-width="36"
  10. outlined
  11. >
  12. <v-icon v-if="approved">
  13. mdi-check
  14. </v-icon>
  15. <v-icon v-else>
  16. mdi-close
  17. </v-icon>
  18. </v-btn>
  19. </template>
  20. <span v-if="approved">Checked</span>
  21. <span v-else>Not checked</span>
  22. </v-tooltip>
  23. </template>
  24. <script>
  25. import { mapActions } from 'vuex'
  26. export default {
  27. props: {
  28. approved: {
  29. type: Boolean,
  30. default: false,
  31. required: true
  32. },
  33. disabled: {
  34. type: Boolean,
  35. default: false
  36. }
  37. },
  38. methods: {
  39. ...mapActions('documents', ['approve']),
  40. approveDocument() {
  41. this.approve({
  42. projectId: this.$route.params.id
  43. })
  44. }
  45. }
  46. }
  47. </script>