MobytStatus.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <v-col cols="12" lg="12">
  3. <strong>{{ $t('remaining_sms_credit') }}</strong> -
  4. <span v-if="!mobytPending && mobytStatus !== null && mobytStatus.active">
  5. {{
  6. mobytStatus.money.toLocaleString($i18n.locale, {
  7. style: 'currency',
  8. currency: 'EUR',
  9. })
  10. }}
  11. {{
  12. i18n.t('convert_price_to_sms', {
  13. nb_sms: mobytStatus.amount,
  14. })
  15. }}
  16. </span>
  17. </v-col>
  18. </template>
  19. <script setup lang="ts">
  20. import type { Ref } from 'vue'
  21. import type { AsyncData } from '#app'
  22. import { useAbility } from '@casl/vue'
  23. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  24. import { useOrganizationProfileStore } from '~/stores/organizationProfile'
  25. import MobytUserStatus from '~/models/Organization/MobytUserStatus'
  26. const ability = useAbility()
  27. const { fetch } = useEntityFetch()
  28. const i18n = useI18n()
  29. const organizationProfile = useOrganizationProfileStore()
  30. const { data: mobytStatus, pending: mobytPending } = fetch(
  31. MobytUserStatus,
  32. organizationProfile.id,
  33. ) as AsyncData<MobytUserStatus | null, Error | null>
  34. </script>
  35. <style scoped lang="scss"></style>