fix: move useState before conditional returns, fix yearly total display

This commit is contained in:
Usman Baig
2026-03-27 11:48:00 +01:00
parent fc5372ff26
commit ad207dc23f
2 changed files with 4 additions and 4 deletions

View File

@@ -123,6 +123,8 @@ function CheckoutContent() {
const searchParams = useSearchParams()
const { user, loading: authLoading } = useAuth()
const { data: subscription } = useSubscription()
const [country, setCountry] = useState('')
const [vatId, setVatId] = useState('')
const status = searchParams.get('status')
const plan = searchParams.get('plan')
@@ -170,8 +172,6 @@ function CheckoutContent() {
const planId = plan!
const billingInterval = interval as 'month' | 'year'
const pageviewLimit = Number(limit)
const [country, setCountry] = useState('')
const [vatId, setVatId] = useState('')
return (
<div className="flex h-screen overflow-hidden">