Your server will {{ pendingChange.verb.toLowerCase() }} to the "{{
@@ -370,14 +248,65 @@ const isFilesExpired = computed(() => {
const thirtyDaysLater = new Date(cancellation.getTime() + 30 * 24 * 60 * 60 * 1000)
return new Date() > thirtyDaysLater
})
-const hasNotice = computed(
- () =>
- isProvisioning.value ||
- props.status === 'suspended' ||
- isSetToCancel.value ||
- !!props.pendingChange,
+
+const hasIconOverlay = computed(
+ () => isProvisioning.value || isUpgrading.value || props.status === 'suspended',
)
+type NoticeType =
+ | 'provisioning'
+ | 'upgrading'
+ | 'cancelled'
+ | 'paymentfailed'
+ | 'moderated'
+ | 'suspended'
+ | 'setToCancel'
+
+const noticeType = computed(() => {
+ if (isProvisioning.value) return 'provisioning'
+ if (props.status === 'suspended') {
+ switch (props.suspension_reason) {
+ case 'upgrading':
+ return 'upgrading'
+ case 'cancelled':
+ return 'cancelled'
+ case 'paymentfailed':
+ return 'paymentfailed'
+ case 'moderated':
+ return 'moderated'
+ default:
+ return 'suspended'
+ }
+ }
+ if (isSetToCancel.value) return 'setToCancel'
+ return null
+})
+
+type NoticeButtons = {
+ downloadBackup?: boolean
+ copyId?: boolean
+ support?: boolean
+ manageBilling?: boolean
+ resubscribe?: boolean
+}
+
+const noticeButtons = computed(() => {
+ switch (noticeType.value) {
+ case 'cancelled':
+ case 'setToCancel':
+ return { downloadBackup: true, copyId: true, support: true, resubscribe: true }
+ case 'paymentfailed':
+ return { downloadBackup: true, copyId: true, support: true, manageBilling: true }
+ case 'moderated':
+ case 'suspended':
+ return { copyId: true, support: true }
+ default:
+ return null
+ }
+})
+
+const hasNotice = computed(() => !!noticeType.value || !!props.pendingChange)
+
const showGameLabel = computed(() => !!props.game && !isConfiguring.value)
const showLoaderLabel = computed(() => !!props.loader && !isConfiguring.value)
const showPlayerCount = computed(() => !!props.playerCount && !isConfiguring.value)