import { FetchError } from '@/infrastructure/fetch-json'
import { Trans } from 'react-i18next'
import OLNotification from '@/shared/components/ol/ol-notification'
import { billingPortalUrl } from '../../data/subscription-url'
type Props = {
error: FetchError | null
}
export default function PaymentErrorNotification({ error }: Props) {
if (!error) {
return
}
let message
switch (error.data?.adviceCode) {
case 'try_again_later':
message = (
,
]}
/>
)
break
case 'do_not_try_again':
case 'confirm_card_data':
message = (
,
]}
/>
)
break
default:
// clientSecret indicates they needed to pass a 3DS challenge
if (error.data?.clientSecret) {
message = (
,
]}
/>
)
} else {
message = (
,
]}
/>
)
}
}
return
}