|
36 | 36 | </div>
|
37 | 37 | </template>
|
38 | 38 |
|
39 |
| -<script> |
| 39 | +<script setup> |
40 | 40 | import { computed } from 'vue'
|
41 |
| -import Modal from './Modal.vue' |
42 |
| -import { useAuthStore } from '../../stores/auth'; |
43 |
| -import { useWorkspacesStore } from '../../stores/workspaces'; |
44 |
| -import PricingTable from "../pages/pricing/PricingTable.vue"; |
45 | 41 |
|
46 |
| -export default { |
47 |
| - name: 'ProTag', |
48 |
| - components: {PricingTable, Modal}, |
49 |
| - props: {}, |
50 |
| -
|
51 |
| - setup () { |
52 |
| - const authStore = useAuthStore() |
53 |
| - const workspacesStore = useWorkspacesStore() |
54 |
| - return { |
55 |
| - user : computed(() => authStore.user), |
56 |
| - currentWorkSpace : computed(() => workspacesStore.getCurrent()) |
57 |
| - } |
58 |
| - }, |
59 |
| -
|
60 |
| - data() { |
61 |
| - return { |
62 |
| - showPremiumModal: false, |
63 |
| - checkoutLoading: false |
64 |
| - } |
65 |
| - }, |
66 |
| -
|
67 |
| - computed: { |
68 |
| - shouldDisplayProTag() { |
69 |
| - if (!this.$config.paid_plans_enabled) return false |
70 |
| - if (!this.user || !this.currentWorkSpace) return true |
71 |
| - return !(this.currentWorkSpace.is_pro) |
72 |
| - }, |
73 |
| - }, |
74 |
| -
|
75 |
| - mounted() { |
76 |
| - }, |
77 |
| -
|
78 |
| - methods: { |
79 |
| - openChat() { |
80 |
| - useCrisp().openAndShowChat() |
81 |
| - }, |
82 |
| - } |
83 |
| -} |
| 42 | +const authStore = useAuthStore() |
| 43 | +const workspacesStore = useWorkspacesStore() |
| 44 | +const user = computed(() => authStore.user) |
| 45 | +const workspace = computed(() => workspacesStore.getCurrent) |
| 46 | +const showPremiumModal = ref(false) |
| 47 | +
|
| 48 | +const shouldDisplayProTag = computed(() => { |
| 49 | + if (!useRuntimeConfig().public.paidPlansEnabled) return false |
| 50 | + if (!user.value || !workspace.value) return true |
| 51 | + return !(workspace.value.is_pro) |
| 52 | +}) |
84 | 53 | </script>
|
0 commit comments