feat: dynamic tax thresholds from backend (#5342)
* feat: dynamic tax thresholds from backend * fix: lint & i18n
This commit is contained in:
@@ -721,6 +721,7 @@ import {
|
||||
} from '@modrinth/ui'
|
||||
import { isAdmin, isStaff, UserBadge } from '@modrinth/utils'
|
||||
|
||||
import { getTaxThreshold } from '@/providers/creator-withdraw.ts'
|
||||
import TextLogo from '~/components/brand/TextLogo.vue'
|
||||
import BatchCreditModal from '~/components/ui/admin/BatchCreditModal.vue'
|
||||
import GeneratedStateErrorsBanner from '~/components/ui/banner/GeneratedStateErrorsBanner.vue'
|
||||
@@ -739,6 +740,8 @@ import TeleportOverflowMenu from '~/components/ui/servers/TeleportOverflowMenu.v
|
||||
import { errors as generatedStateErrors } from '~/generated/state.json'
|
||||
import { getProjectTypeMessage } from '~/utils/i18n-project-type.ts'
|
||||
|
||||
const generatedState = useGeneratedState()
|
||||
|
||||
const country = useUserCountry()
|
||||
|
||||
const { formatMessage } = useVIntl()
|
||||
@@ -763,7 +766,8 @@ const showTaxComplianceBanner = computed(() => {
|
||||
if (flags.value.testTaxForm && auth.value.user) return true
|
||||
const bal = payoutBalance.value
|
||||
if (!bal) return false
|
||||
const thresholdMet = (bal.withdrawn_ytd ?? 0) >= 600
|
||||
const threshold = getTaxThreshold(generatedState.value?.taxComplianceThresholds)
|
||||
const thresholdMet = (bal.withdrawn_ytd ?? 0) >= threshold
|
||||
const status = bal.form_completion_status ?? 'unknown'
|
||||
const isComplete = status === 'complete'
|
||||
const isTinMismatch = status === 'tin-mismatch'
|
||||
|
||||
Reference in New Issue
Block a user