@greatapps/common 1.1.675 → 1.1.677
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +8 -6
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +20 -19
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +10 -11
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +34 -28
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +7 -5
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -9
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +22 -23
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/constants.mjs +4 -4
- package/dist/components/account/constants.mjs.map +1 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +5 -3
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +26 -3
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +18 -9
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +26 -3
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +19 -3
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +27 -4
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +25 -28
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +8 -6
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +24 -27
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +37 -22
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +48 -24
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +11 -9
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/TokenSection.mjs +24 -8
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +2 -148
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +5 -3
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +5 -3
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +6 -4
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +9 -7
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/BuyCreditsModal.mjs +17 -18
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
- package/dist/components/modals/CreditsDisabledModal.mjs +6 -4
- package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +5 -3
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs +64 -46
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs +9 -7
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs +65 -51
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/modals/cards/DeleteCardModal.mjs +10 -8
- package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +4 -2
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/OverdueInvoiceBanner.mjs +4 -2
- package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/PendingCancellationBanner.mjs +4 -6
- package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +8 -6
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs +4 -6
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +5 -3
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +3 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +3 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +5 -3
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs +5 -3
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +13 -10
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +9 -5
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +7 -5
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentInfoCard.mjs +10 -8
- package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +3 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +11 -6
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs +5 -2
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +5 -2
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/PhoneInput.mjs +5 -3
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
- package/dist/components/ui/form/SelectField.mjs +6 -3
- package/dist/components/ui/form/SelectField.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +11 -18
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +6 -15
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
- package/dist/i18n/config.mjs +13 -0
- package/dist/i18n/config.mjs.map +1 -0
- package/dist/i18n/country-language.mjs +74 -0
- package/dist/i18n/country-language.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +494 -0
- package/dist/i18n/messages/en-us.mjs.map +1 -0
- package/dist/i18n/messages/es-es.mjs +494 -0
- package/dist/i18n/messages/es-es.mjs.map +1 -0
- package/dist/i18n/messages/index.mjs +16 -0
- package/dist/i18n/messages/index.mjs.map +1 -0
- package/dist/i18n/messages/pt-br.mjs +507 -0
- package/dist/i18n/messages/pt-br.mjs.map +1 -0
- package/dist/i18n/normalize.mjs +12 -0
- package/dist/i18n/normalize.mjs.map +1 -0
- package/dist/i18n/resolve-locale.mjs +42 -0
- package/dist/i18n/resolve-locale.mjs.map +1 -0
- package/dist/i18n.mjs +14 -0
- package/dist/i18n.mjs.map +1 -0
- package/dist/index.mjs +19 -3
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +1 -0
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +2 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
- package/dist/modules/images/utils/validate-image.mjs +8 -8
- package/dist/modules/images/utils/validate-image.mjs.map +1 -1
- package/dist/modules/plans/hooks/list-plans.hook.mjs +2 -2
- package/dist/modules/plans/hooks/list-plans.hook.mjs.map +1 -1
- package/dist/modules/plans/types/plan.type.mjs +5 -1
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +61 -35
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
- package/dist/modules/projects/services/projects.service.mjs +9 -0
- package/dist/modules/projects/services/projects.service.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs +20 -14
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs +9 -1
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/server.mjs +2 -0
- package/dist/server.mjs.map +1 -1
- package/dist/utils/format/currency.mjs +32 -4
- package/dist/utils/format/currency.mjs.map +1 -1
- package/dist/utils/intl/cookie-domain.mjs +17 -0
- package/dist/utils/intl/cookie-domain.mjs.map +1 -0
- package/dist/utils/intl/locale-cookie.mjs +13 -0
- package/dist/utils/intl/locale-cookie.mjs.map +1 -0
- package/dist/utils/intl/locales.mjs +3 -2
- package/dist/utils/intl/locales.mjs.map +1 -1
- package/package.json +7 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +10 -6
- package/src/components/account/ConfirmDeleteAccountModal.tsx +22 -13
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +12 -10
- package/src/components/account/DeleteAccountModal.tsx +34 -24
- package/src/components/account/DisableTwoFactorAuthModal.tsx +11 -6
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +8 -6
- package/src/components/account/TwoFactorAuthModal.tsx +33 -29
- package/src/components/account/constants.ts +8 -5
- package/src/components/account/hooks/useChangeEmailForm.tsx +5 -3
- package/src/components/account/hooks/useChangePasswordForm.tsx +20 -6
- package/src/components/account/hooks/useChangePhoneForm.tsx +16 -10
- package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +20 -6
- package/src/components/account/hooks/useOtpVerification.tsx +16 -4
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +21 -7
- package/src/components/account/sections/ChangeEmailModal.tsx +35 -21
- package/src/components/account/sections/ChangePasswordSection.tsx +10 -6
- package/src/components/account/sections/ChangePhoneModal.tsx +50 -22
- package/src/components/account/sections/MyProfileSection.tsx +37 -23
- package/src/components/account/sections/PreferencesSection.tsx +52 -25
- package/src/components/account/sections/SecuritySection.tsx +19 -10
- package/src/components/account/sections/TokenSection.tsx +22 -10
- package/src/components/layouts/AppMobileNavBar.tsx +1 -154
- package/src/components/layouts/NavBar.tsx +5 -3
- package/src/components/layouts/NotificationsPopover.tsx +5 -3
- package/src/components/layouts/ProfilePopover.tsx +6 -4
- package/src/components/layouts/UsersSelectorPopover.tsx +9 -7
- package/src/components/modals/BuyCreditsModal.tsx +18 -16
- package/src/components/modals/CreditsDisabledModal.tsx +6 -6
- package/src/components/modals/PaidPlanRequiredModal.tsx +5 -3
- package/src/components/modals/cards/AddCardModal.tsx +89 -62
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +9 -8
- package/src/components/modals/cards/CardFormFields.tsx +93 -75
- package/src/components/modals/cards/DeleteCardModal.tsx +10 -8
- package/src/components/navigation/CancelledSubscriptionBanner.tsx +4 -2
- package/src/components/navigation/OverdueInvoiceBanner.tsx +4 -2
- package/src/components/navigation/PendingCancellationBanner.tsx +4 -2
- package/src/components/navigation/ProjectSelectorPopover.tsx +8 -6
- package/src/components/navigation/UpcomingInvoiceBanner.tsx +4 -2
- package/src/components/navigation/subcomponents/BottomLinks.tsx +5 -3
- package/src/components/navigation/subcomponents/CreditsCard.tsx +3 -1
- package/src/components/navigation/subcomponents/PlanCard.tsx +3 -1
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +5 -3
- package/src/components/pages/NotFoundPage.tsx +5 -3
- package/src/components/pages/notifications/Notifications.tsx +13 -10
- package/src/components/ui/buttons/CopyButton.tsx +10 -5
- package/src/components/ui/data-display/CardItem.tsx +7 -5
- package/src/components/ui/data-display/PaymentInfoCard.tsx +10 -8
- package/src/components/ui/feedback/CircularProgress.tsx +4 -0
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +3 -1
- package/src/components/ui/form/ComboboxField.tsx +11 -6
- package/src/components/ui/form/DatePicker.tsx +5 -2
- package/src/components/ui/form/DateRangePicker.tsx +5 -2
- package/src/components/ui/form/PhoneInput.tsx +5 -3
- package/src/components/ui/form/SelectField.tsx +6 -3
- package/src/components/widgets/ImageUpload/ImageCropModal.tsx +19 -11
- package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +6 -5
- package/src/i18n/config.ts +17 -0
- package/src/i18n/country-language.ts +60 -0
- package/src/i18n/messages/en-us.ts +514 -0
- package/src/i18n/messages/es-es.ts +515 -0
- package/src/i18n/messages/index.ts +24 -0
- package/src/i18n/messages/pt-br.ts +538 -0
- package/src/i18n/normalize.ts +15 -0
- package/src/i18n/resolve-locale.ts +77 -0
- package/src/i18n.ts +10 -0
- package/src/index.ts +13 -2
- package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +32 -0
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +8 -3
- package/src/modules/images/utils/validate-image.ts +23 -8
- package/src/modules/plans/hooks/list-plans.hook.ts +2 -2
- package/src/modules/plans/types/plan.type.ts +4 -0
- package/src/modules/plans/utils/map-api-plan-to-ui.ts +109 -47
- package/src/modules/projects/services/projects.service.ts +12 -0
- package/src/modules/subscriptions/utils/periodicity.ts +29 -12
- package/src/providers/auth.provider.tsx +13 -1
- package/src/server.ts +2 -0
- package/src/utils/format/currency.ts +62 -7
- package/src/utils/intl/cookie-domain.ts +29 -0
- package/src/utils/intl/locale-cookie.ts +18 -0
- package/src/utils/intl/locales.ts +3 -2
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
CardExpiryElement,
|
|
17
17
|
CardNumberElement,
|
|
18
18
|
} from "@stripe/react-stripe-js";
|
|
19
|
+
import { useTranslations } from "next-intl";
|
|
19
20
|
|
|
20
21
|
const stripeElementOptions = {
|
|
21
22
|
style: {
|
|
@@ -30,23 +31,24 @@ const stripeElementOptions = {
|
|
|
30
31
|
},
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
export
|
|
34
|
-
.object({
|
|
34
|
+
export function buildCardFormSchema(isInternational: boolean) {
|
|
35
|
+
const base = z.object({
|
|
35
36
|
name: z.string().min(1, "Nome é obrigatório"),
|
|
36
37
|
country: z.string().min(1, "País é obrigatório"),
|
|
37
|
-
personType: z.enum(["pf", "pj"]),
|
|
38
|
+
personType: z.enum(["pf", "pj"]).optional(),
|
|
38
39
|
cpf: z.string().optional(),
|
|
39
40
|
cnpj: z.string().optional(),
|
|
40
41
|
fullName: z.string().min(1, "Nome completo é obrigatório"),
|
|
41
|
-
cep: z.string().min(9, "CEP é obrigatório"),
|
|
42
|
+
cep: z.string().min(isInternational ? 1 : 9, isInternational ? "Código postal é obrigatório" : "CEP é obrigatório"),
|
|
42
43
|
street: z.string().min(1, "Endereço é obrigatório"),
|
|
43
|
-
streetNumber: z.string().min(1, "Número é obrigatório"),
|
|
44
|
+
streetNumber: isInternational ? z.string().optional() : z.string().min(1, "Número é obrigatório"),
|
|
44
45
|
city: z.string().min(1, "Cidade é obrigatória"),
|
|
45
46
|
state: z.string().min(1, "UF é obrigatório"),
|
|
46
|
-
neighborhood: z.string().min(1, "Bairro é obrigatório"),
|
|
47
|
+
neighborhood: isInternational ? z.string().optional() : z.string().min(1, "Bairro é obrigatório"),
|
|
47
48
|
complement: z.string().optional(),
|
|
48
|
-
})
|
|
49
|
-
|
|
49
|
+
});
|
|
50
|
+
if (isInternational) return base;
|
|
51
|
+
return base.refine(
|
|
50
52
|
(data) => {
|
|
51
53
|
if (data.personType === "pf") return !!data.cpf && data.cpf.length >= 14;
|
|
52
54
|
return !!data.cnpj && data.cnpj.length >= 18;
|
|
@@ -56,6 +58,9 @@ export const cardFormSchema = z
|
|
|
56
58
|
path: ["cpf"],
|
|
57
59
|
},
|
|
58
60
|
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const cardFormSchema = buildCardFormSchema(false);
|
|
59
64
|
|
|
60
65
|
export type CardFormData = z.infer<typeof cardFormSchema>;
|
|
61
66
|
|
|
@@ -84,13 +89,16 @@ type CardFormFieldsProps = {
|
|
|
84
89
|
cardExpiry?: string;
|
|
85
90
|
cardCvc?: string;
|
|
86
91
|
};
|
|
92
|
+
readonly isInternational?: boolean;
|
|
87
93
|
};
|
|
88
94
|
|
|
89
95
|
export function CardFormFields({
|
|
90
96
|
form,
|
|
91
97
|
onStripeChange,
|
|
92
98
|
stripeErrors,
|
|
99
|
+
isInternational = false,
|
|
93
100
|
}: CardFormFieldsProps) {
|
|
101
|
+
const translate = useTranslations();
|
|
94
102
|
const {
|
|
95
103
|
register,
|
|
96
104
|
watch,
|
|
@@ -103,8 +111,8 @@ export function CardFormFields({
|
|
|
103
111
|
return (
|
|
104
112
|
<div className="flex flex-col gap-5">
|
|
105
113
|
<FormField
|
|
106
|
-
label=
|
|
107
|
-
placeholder=
|
|
114
|
+
label={translate('common.cards.form.nameOnCard')}
|
|
115
|
+
placeholder={translate('common.cards.form.typeHere')}
|
|
108
116
|
{...register("name")}
|
|
109
117
|
error={!!errors.name}
|
|
110
118
|
errorMessage={errors.name?.message}
|
|
@@ -112,7 +120,7 @@ export function CardFormFields({
|
|
|
112
120
|
|
|
113
121
|
<div className="flex flex-col gap-1.5">
|
|
114
122
|
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
115
|
-
|
|
123
|
+
{translate('common.cards.form.cardNumber')}
|
|
116
124
|
</label>
|
|
117
125
|
<div className="h-10 px-3 flex items-center w-full border border-zinc-200 rounded-lg bg-white transition-colors focus-within:border-zinc-400 relative">
|
|
118
126
|
<div className="w-full">
|
|
@@ -134,7 +142,7 @@ export function CardFormFields({
|
|
|
134
142
|
<div className="flex gap-4">
|
|
135
143
|
<div className="flex-1 flex flex-col gap-1.5">
|
|
136
144
|
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
137
|
-
|
|
145
|
+
{translate('common.cards.form.cardExpiry')}
|
|
138
146
|
</label>
|
|
139
147
|
<div className="h-10 px-3 flex items-center w-full border border-zinc-200 rounded-lg bg-white transition-colors focus-within:border-zinc-400">
|
|
140
148
|
<div className="w-full">
|
|
@@ -154,7 +162,7 @@ export function CardFormFields({
|
|
|
154
162
|
</div>
|
|
155
163
|
|
|
156
164
|
<div className="flex-1 flex flex-col gap-1.5">
|
|
157
|
-
<label className="paragraph-xsmall-semibold text-zinc-600">
|
|
165
|
+
<label className="paragraph-xsmall-semibold text-zinc-600">{translate('common.cards.form.cardCvc')}</label>
|
|
158
166
|
<div className="h-10 px-3 flex items-center w-full border border-zinc-200 rounded-lg bg-white transition-colors focus-within:border-zinc-400">
|
|
159
167
|
<div className="w-full">
|
|
160
168
|
<CardCvcElement
|
|
@@ -174,66 +182,70 @@ export function CardFormFields({
|
|
|
174
182
|
</div>
|
|
175
183
|
|
|
176
184
|
<SelectField
|
|
177
|
-
label=
|
|
178
|
-
placeholder=
|
|
185
|
+
label={translate('common.cards.form.country')}
|
|
186
|
+
placeholder={translate('common.cards.form.select')}
|
|
179
187
|
value={watch("country")}
|
|
180
188
|
onChange={(value) => setValue("country", value as string)}
|
|
181
189
|
options={COUNTRIES.map((c) => ({ value: c.iso, label: c.name }))}
|
|
182
190
|
/>
|
|
183
191
|
|
|
184
|
-
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
192
|
+
{!isInternational && (
|
|
193
|
+
<div className="flex gap-4">
|
|
194
|
+
<SelectField
|
|
195
|
+
label={translate('common.cards.form.personType')}
|
|
196
|
+
placeholder={translate('common.cards.form.select')}
|
|
197
|
+
value={personType}
|
|
198
|
+
onChange={(value) => {
|
|
199
|
+
setValue("personType", value as "pf" | "pj");
|
|
200
|
+
setValue("cpf", "");
|
|
201
|
+
setValue("cnpj", "");
|
|
202
|
+
}}
|
|
203
|
+
options={[
|
|
204
|
+
{ value: "pf", label: translate('common.cards.form.personTypePf') },
|
|
205
|
+
{ value: "pj", label: translate('common.cards.form.personTypePj') },
|
|
206
|
+
]}
|
|
207
|
+
containerClassName="flex-1"
|
|
208
|
+
/>
|
|
209
|
+
<div className="flex-1">
|
|
210
|
+
{personType === "pj" ? (
|
|
211
|
+
<FormField
|
|
212
|
+
label={translate('common.cards.form.cnpj')}
|
|
213
|
+
placeholder="__.___.___/____-__"
|
|
214
|
+
{...register("cnpj", {
|
|
215
|
+
onChange: (e) => {
|
|
216
|
+
setValue("cnpj", formatCNPJ(e.target.value));
|
|
217
|
+
},
|
|
218
|
+
})}
|
|
219
|
+
error={!!errors.cpf}
|
|
220
|
+
errorMessage={errors.cpf?.message}
|
|
221
|
+
/>
|
|
222
|
+
) : (
|
|
223
|
+
<FormField
|
|
224
|
+
label={translate('common.cards.form.cpf')}
|
|
225
|
+
placeholder="___.___.___-__"
|
|
226
|
+
{...register("cpf", {
|
|
227
|
+
onChange: (e) => {
|
|
228
|
+
setValue("cpf", formatCPF(e.target.value));
|
|
229
|
+
},
|
|
230
|
+
})}
|
|
231
|
+
error={!!errors.cpf}
|
|
232
|
+
errorMessage={errors.cpf?.message}
|
|
233
|
+
/>
|
|
234
|
+
)}
|
|
235
|
+
</div>
|
|
226
236
|
</div>
|
|
227
|
-
|
|
237
|
+
)}
|
|
228
238
|
</div>
|
|
229
239
|
);
|
|
230
240
|
}
|
|
231
241
|
|
|
232
242
|
type BillingFormFieldsProps = {
|
|
233
243
|
readonly form: UseFormReturn<CardFormData>;
|
|
244
|
+
readonly isInternational?: boolean;
|
|
234
245
|
};
|
|
235
246
|
|
|
236
|
-
export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
247
|
+
export function BillingFormFields({ form, isInternational = false }: BillingFormFieldsProps) {
|
|
248
|
+
const translate = useTranslations();
|
|
237
249
|
const {
|
|
238
250
|
register,
|
|
239
251
|
setValue,
|
|
@@ -243,6 +255,10 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
243
255
|
const { mutateAsync: lookupCep } = useViaCep();
|
|
244
256
|
|
|
245
257
|
const handleCepChange = (rawValue: string) => {
|
|
258
|
+
if (isInternational) {
|
|
259
|
+
setValue("cep", rawValue);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
246
262
|
const masked = formatPostalCode(rawValue);
|
|
247
263
|
setValue("cep", masked);
|
|
248
264
|
|
|
@@ -264,16 +280,16 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
264
280
|
return (
|
|
265
281
|
<div className="flex flex-col gap-5">
|
|
266
282
|
<FormField
|
|
267
|
-
label=
|
|
268
|
-
placeholder=
|
|
283
|
+
label={translate('common.cards.form.fullName')}
|
|
284
|
+
placeholder={translate('common.cards.form.typeHere')}
|
|
269
285
|
{...register("fullName")}
|
|
270
286
|
error={!!errors.fullName}
|
|
271
287
|
errorMessage={errors.fullName?.message}
|
|
272
288
|
/>
|
|
273
289
|
|
|
274
290
|
<FormField
|
|
275
|
-
label=
|
|
276
|
-
placeholder="_____-___"
|
|
291
|
+
label={isInternational ? translate('common.cards.form.postalCode') : translate('common.cards.form.cep')}
|
|
292
|
+
placeholder={isInternational ? "" : "_____-___"}
|
|
277
293
|
{...register("cep", {
|
|
278
294
|
onChange: (e) => handleCepChange(e.target.value),
|
|
279
295
|
})}
|
|
@@ -284,7 +300,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
284
300
|
<div className="flex gap-4">
|
|
285
301
|
<div className="flex-[4]">
|
|
286
302
|
<FormField
|
|
287
|
-
label=
|
|
303
|
+
label={translate('common.cards.form.street')}
|
|
288
304
|
placeholder=""
|
|
289
305
|
{...register("street")}
|
|
290
306
|
error={!!errors.street}
|
|
@@ -293,7 +309,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
293
309
|
</div>
|
|
294
310
|
<div className="flex-[1]">
|
|
295
311
|
<FormField
|
|
296
|
-
label=
|
|
312
|
+
label={translate('common.cards.form.streetNumber')}
|
|
297
313
|
placeholder=""
|
|
298
314
|
{...register("streetNumber")}
|
|
299
315
|
error={!!errors.streetNumber}
|
|
@@ -305,7 +321,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
305
321
|
<div className="flex gap-4">
|
|
306
322
|
<div className="flex-1">
|
|
307
323
|
<FormField
|
|
308
|
-
label=
|
|
324
|
+
label={translate('common.cards.form.city')}
|
|
309
325
|
placeholder=""
|
|
310
326
|
{...register("city")}
|
|
311
327
|
error={!!errors.city}
|
|
@@ -314,7 +330,7 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
314
330
|
</div>
|
|
315
331
|
<div className="flex-1">
|
|
316
332
|
<FormField
|
|
317
|
-
label=
|
|
333
|
+
label={isInternational ? translate('common.cards.form.stateProvince') : translate('common.cards.form.state')}
|
|
318
334
|
placeholder=""
|
|
319
335
|
{...register("state")}
|
|
320
336
|
error={!!errors.state}
|
|
@@ -324,15 +340,17 @@ export function BillingFormFields({ form }: BillingFormFieldsProps) {
|
|
|
324
340
|
</div>
|
|
325
341
|
|
|
326
342
|
<div className="flex gap-4">
|
|
343
|
+
{!isInternational && (
|
|
344
|
+
<FormField
|
|
345
|
+
label={translate('common.cards.form.neighborhood')}
|
|
346
|
+
placeholder=""
|
|
347
|
+
{...register("neighborhood")}
|
|
348
|
+
error={!!errors.neighborhood}
|
|
349
|
+
errorMessage={errors.neighborhood?.message}
|
|
350
|
+
/>
|
|
351
|
+
)}
|
|
327
352
|
<FormField
|
|
328
|
-
label=
|
|
329
|
-
placeholder=""
|
|
330
|
-
{...register("neighborhood")}
|
|
331
|
-
error={!!errors.neighborhood}
|
|
332
|
-
errorMessage={errors.neighborhood?.message}
|
|
333
|
-
/>
|
|
334
|
-
<FormField
|
|
335
|
-
label="Complemento"
|
|
353
|
+
label={translate('common.cards.form.complement')}
|
|
336
354
|
optional
|
|
337
355
|
placeholder=""
|
|
338
356
|
{...register("complement")}
|
|
@@ -17,8 +17,10 @@ import { useModalManager } from '../../../store/useModalManager';
|
|
|
17
17
|
import { useDeleteConfirmation } from '../../../modules/cards/hooks/delete-confirmation.hook';
|
|
18
18
|
import { useDeleteCard } from '../../../modules/cards/hooks/delete-card.hook';
|
|
19
19
|
import { useCards } from '../../../modules/cards/hooks/cards.hook';
|
|
20
|
+
import { useTranslations } from 'next-intl';
|
|
20
21
|
|
|
21
22
|
export function DeleteCardModal() {
|
|
23
|
+
const translate = useTranslations();
|
|
22
24
|
const { activeModal, modalData, closeModal } = useModalManager();
|
|
23
25
|
const { form, isValidConfirmation, resetConfirmation } = useDeleteConfirmation();
|
|
24
26
|
const deleteCard = useDeleteCard();
|
|
@@ -50,7 +52,7 @@ export function DeleteCardModal() {
|
|
|
50
52
|
message={
|
|
51
53
|
error instanceof Error
|
|
52
54
|
? error.message
|
|
53
|
-
: '
|
|
55
|
+
: translate('common.cards.delete.errorToast')
|
|
54
56
|
}
|
|
55
57
|
/>
|
|
56
58
|
),
|
|
@@ -67,7 +69,7 @@ export function DeleteCardModal() {
|
|
|
67
69
|
(t) => (
|
|
68
70
|
<Toast
|
|
69
71
|
variant="success"
|
|
70
|
-
message={
|
|
72
|
+
message={translate('common.cards.delete.successToast', { digits: cardLastDigits })}
|
|
71
73
|
toastId={t}
|
|
72
74
|
/>
|
|
73
75
|
),
|
|
@@ -85,10 +87,10 @@ export function DeleteCardModal() {
|
|
|
85
87
|
</div>
|
|
86
88
|
<div className="flex flex-col gap-2">
|
|
87
89
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
88
|
-
|
|
90
|
+
{translate('common.cards.delete.title')}
|
|
89
91
|
</DialogTitle>
|
|
90
92
|
<DialogDescription className="paragraph-small-regular text-zinc-600">
|
|
91
|
-
|
|
93
|
+
{translate('common.cards.delete.description')}{' '}
|
|
92
94
|
<span className="font-semibold text-zinc-950">
|
|
93
95
|
•••• {cardLastDigits}
|
|
94
96
|
</span>
|
|
@@ -99,9 +101,9 @@ export function DeleteCardModal() {
|
|
|
99
101
|
|
|
100
102
|
<div className="px-4 lg:px-5 py-5">
|
|
101
103
|
<FormField
|
|
102
|
-
label=
|
|
104
|
+
label={translate('common.cards.delete.confirmLabel')}
|
|
103
105
|
required
|
|
104
|
-
placeholder=
|
|
106
|
+
placeholder={translate('common.cards.delete.confirmPlaceholder')}
|
|
105
107
|
{...form.register('confirmText')}
|
|
106
108
|
/>
|
|
107
109
|
</div>
|
|
@@ -113,7 +115,7 @@ export function DeleteCardModal() {
|
|
|
113
115
|
loading={form.formState.isSubmitting}
|
|
114
116
|
className="h-10!"
|
|
115
117
|
>
|
|
116
|
-
{form.formState.isSubmitting ? '
|
|
118
|
+
{form.formState.isSubmitting ? translate('common.cards.delete.deleting') : translate('common.actions.delete')}
|
|
117
119
|
</Button>
|
|
118
120
|
<Button
|
|
119
121
|
type="button"
|
|
@@ -122,7 +124,7 @@ export function DeleteCardModal() {
|
|
|
122
124
|
onClick={handleClose}
|
|
123
125
|
disabled={form.formState.isSubmitting}
|
|
124
126
|
>
|
|
125
|
-
|
|
127
|
+
{translate('common.actions.cancel')}
|
|
126
128
|
</Button>
|
|
127
129
|
</div>
|
|
128
130
|
</form>
|
|
@@ -5,12 +5,14 @@ import { IconAlertOctagon, IconX } from '@tabler/icons-react';
|
|
|
5
5
|
import { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';
|
|
6
6
|
import { toCalendarDate } from '../../infra/utils/date';
|
|
7
7
|
import { getSubscriptionExpiryDate } from '../../modules/subscriptions/utils/get-subscription-expiry-date';
|
|
8
|
+
import { useTranslations } from 'next-intl';
|
|
8
9
|
|
|
9
10
|
interface CancelledSubscriptionBannerProps {
|
|
10
11
|
onReactivate?: () => void;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscriptionBannerProps) {
|
|
15
|
+
const translate = useTranslations();
|
|
14
16
|
const { data: { data: [subscription] = [] } = {} } = useActiveSubscription();
|
|
15
17
|
const [visible, setVisible] = useState(true);
|
|
16
18
|
const [animated, setAnimated] = useState(false);
|
|
@@ -40,7 +42,7 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
|
|
|
40
42
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
41
43
|
<IconAlertOctagon size={16} className="text-white shrink-0" />
|
|
42
44
|
<span className="paragraph-xsmall-semibold text-white">
|
|
43
|
-
|
|
45
|
+
{translate('common.navigation.banners.cancelled.message')}
|
|
44
46
|
</span>
|
|
45
47
|
</div>
|
|
46
48
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -50,7 +52,7 @@ export function CancelledSubscriptionBanner({ onReactivate }: CancelledSubscript
|
|
|
50
52
|
onClick={onReactivate}
|
|
51
53
|
>
|
|
52
54
|
<span className="paragraph-xsmall-semibold text-white underline">
|
|
53
|
-
|
|
55
|
+
{translate('common.navigation.banners.cancelled.choosePlan')}
|
|
54
56
|
</span>
|
|
55
57
|
</button>
|
|
56
58
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
|
5
|
+
import { useTranslations } from 'next-intl';
|
|
5
6
|
|
|
6
7
|
interface OverdueInvoiceBannerProps {
|
|
7
8
|
onDetails?: () => void;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
12
|
+
const translate = useTranslations();
|
|
11
13
|
const [visible, setVisible] = useState(true);
|
|
12
14
|
const [animated, setAnimated] = useState(false);
|
|
13
15
|
|
|
@@ -28,7 +30,7 @@ export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
|
28
30
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
29
31
|
<IconAlertTriangle size={16} className="text-white shrink-0" />
|
|
30
32
|
<span className="paragraph-xsmall-semibold text-white">
|
|
31
|
-
|
|
33
|
+
{translate('common.navigation.banners.overdue.message')}
|
|
32
34
|
</span>
|
|
33
35
|
</div>
|
|
34
36
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -37,7 +39,7 @@ export function OverdueInvoiceBanner({ onDetails }: OverdueInvoiceBannerProps) {
|
|
|
37
39
|
className="flex items-center justify-center p-1.5 cursor-pointer"
|
|
38
40
|
onClick={onDetails}
|
|
39
41
|
>
|
|
40
|
-
<span className="paragraph-xsmall-semibold text-white underline">
|
|
42
|
+
<span className="paragraph-xsmall-semibold text-white underline">{translate('common.navigation.banners.overdue.details')}</span>
|
|
41
43
|
</button>
|
|
42
44
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
43
45
|
<IconX size={18} className="text-orange-200" />
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
|
5
5
|
import { formatShortDate } from '../../infra/utils/date';
|
|
6
|
+
import { useTranslations } from 'next-intl';
|
|
6
7
|
|
|
7
8
|
interface PendingCancellationBannerProps {
|
|
8
9
|
limitDate?: Date | null;
|
|
@@ -13,6 +14,7 @@ export function PendingCancellationBanner({
|
|
|
13
14
|
limitDate,
|
|
14
15
|
onReactivate,
|
|
15
16
|
}: PendingCancellationBannerProps) {
|
|
17
|
+
const translate = useTranslations();
|
|
16
18
|
const [visible, setVisible] = useState(true);
|
|
17
19
|
const [animated, setAnimated] = useState(false);
|
|
18
20
|
|
|
@@ -35,7 +37,7 @@ export function PendingCancellationBanner({
|
|
|
35
37
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
36
38
|
<IconAlertTriangle size={16} className="text-zinc-950 shrink-0" />
|
|
37
39
|
<span className="paragraph-xsmall-semibold text-zinc-950">
|
|
38
|
-
|
|
40
|
+
{translate('common.navigation.banners.pending.message', { limitDate: formattedLimitDate ?? '' })}
|
|
39
41
|
</span>
|
|
40
42
|
</div>
|
|
41
43
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -45,7 +47,7 @@ export function PendingCancellationBanner({
|
|
|
45
47
|
onClick={onReactivate}
|
|
46
48
|
>
|
|
47
49
|
<span className="paragraph-xsmall-semibold text-zinc-950 underline">
|
|
48
|
-
|
|
50
|
+
{translate('common.navigation.banners.pending.reactivate')}
|
|
49
51
|
</span>
|
|
50
52
|
</button>
|
|
51
53
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { Dispatch, RefObject, SetStateAction, UIEvent, useCallback } from 'react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
4
5
|
import {
|
|
5
6
|
Button,
|
|
6
7
|
Command,
|
|
@@ -61,6 +62,7 @@ export function ProjectSelectorPopover({
|
|
|
61
62
|
onSearchChange,
|
|
62
63
|
children,
|
|
63
64
|
}: ProjectSelectorPopoverProps) {
|
|
65
|
+
const translate = useTranslations();
|
|
64
66
|
const handleListScroll = useCallback((event: UIEvent<HTMLDivElement>) => {
|
|
65
67
|
if (!hasNextPage || isFetchingNextPage || !onLoadMore) return;
|
|
66
68
|
|
|
@@ -96,10 +98,10 @@ export function ProjectSelectorPopover({
|
|
|
96
98
|
>
|
|
97
99
|
<div className="flex flex-col p-3 gap-2">
|
|
98
100
|
<div className="flex items-center justify-between">
|
|
99
|
-
<span className="paragraph-small-semibold">
|
|
101
|
+
<span className="paragraph-small-semibold">{translate('common.navigation.projectSelector.title')}</span>
|
|
100
102
|
</div>
|
|
101
103
|
<Command className="gap-2" defaultValue=" " shouldFilter={!onSearchChange} value=" " onValueChange={() => {}}>
|
|
102
|
-
<CommandInput placeholder=
|
|
104
|
+
<CommandInput placeholder={translate('common.navigation.projectSelector.searchPlaceholder')} value={search} onValueChange={onSearchChange} />
|
|
103
105
|
<CommandList
|
|
104
106
|
className="custom-scrollbar paragraph-small-medium text-gray-600 max-h-[227px]"
|
|
105
107
|
onScroll={handleListScroll}
|
|
@@ -115,14 +117,14 @@ export function ProjectSelectorPopover({
|
|
|
115
117
|
<div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
|
|
116
118
|
<IconFolderOpen size={28} className="text-gray-300" />
|
|
117
119
|
<span className="paragraph-small-medium text-center text-gray-500">
|
|
118
|
-
|
|
120
|
+
{translate('common.navigation.projectSelector.emptyLine1')}
|
|
119
121
|
<br />
|
|
120
|
-
|
|
122
|
+
{translate('common.navigation.projectSelector.emptyLine2')}
|
|
121
123
|
</span>
|
|
122
124
|
</div>
|
|
123
125
|
) : (
|
|
124
126
|
<>
|
|
125
|
-
<CommandEmpty>
|
|
127
|
+
<CommandEmpty>{translate('common.navigation.projectSelector.noResults')}</CommandEmpty>
|
|
126
128
|
{projects.map((project) => {
|
|
127
129
|
const isSelected = selectedProject?.id === project.id;
|
|
128
130
|
return (
|
|
@@ -167,7 +169,7 @@ export function ProjectSelectorPopover({
|
|
|
167
169
|
className="h-10! paragraph-small-medium text-gray-600 hover:text-gray-950 hover:bg-zinc-50 w-full justify-center"
|
|
168
170
|
onClick={onManageProjects}
|
|
169
171
|
>
|
|
170
|
-
|
|
172
|
+
{translate('common.navigation.projectSelector.manageProjects')}
|
|
171
173
|
</Button>
|
|
172
174
|
</>
|
|
173
175
|
)}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { IconAlertTriangle, IconX } from '@tabler/icons-react';
|
|
5
5
|
import { formatShortDate } from '../../infra/utils/date';
|
|
6
|
+
import { useTranslations } from 'next-intl';
|
|
6
7
|
|
|
7
8
|
interface UpcomingInvoiceBannerProps {
|
|
8
9
|
dueDate?: Date | null;
|
|
@@ -10,6 +11,7 @@ interface UpcomingInvoiceBannerProps {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBannerProps) {
|
|
14
|
+
const translate = useTranslations();
|
|
13
15
|
const [visible, setVisible] = useState(true);
|
|
14
16
|
const [animated, setAnimated] = useState(false);
|
|
15
17
|
|
|
@@ -32,7 +34,7 @@ export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBan
|
|
|
32
34
|
<div className="flex items-center gap-2 flex-1 w-full sm:w-auto">
|
|
33
35
|
<IconAlertTriangle size={16} className="text-zinc-950 shrink-0" />
|
|
34
36
|
<span className="paragraph-xsmall-semibold text-zinc-950">
|
|
35
|
-
|
|
37
|
+
{translate('common.navigation.banners.upcoming.message', { dueDate: formattedDueDate ?? '' })}
|
|
36
38
|
</span>
|
|
37
39
|
</div>
|
|
38
40
|
<div className="flex items-center gap-1.5 w-full sm:w-auto justify-between sm:justify-start">
|
|
@@ -41,7 +43,7 @@ export function UpcomingInvoiceBanner({ dueDate, onDetails }: UpcomingInvoiceBan
|
|
|
41
43
|
className="flex items-center justify-center p-1.5 cursor-pointer"
|
|
42
44
|
onClick={onDetails}
|
|
43
45
|
>
|
|
44
|
-
<span className="paragraph-xsmall-semibold text-zinc-950 underline">
|
|
46
|
+
<span className="paragraph-xsmall-semibold text-zinc-950 underline">{translate('common.navigation.banners.upcoming.details')}</span>
|
|
45
47
|
</button>
|
|
46
48
|
<button type="button" className="cursor-pointer shrink-0" onClick={dismiss}>
|
|
47
49
|
<IconX size={18} className="text-zinc-700" />
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { IconHelp, IconBulb, IconStar, type TablerIcon } from '@tabler/icons-react';
|
|
4
4
|
import { useIsDefaultWhitelabel, useWhitelabel } from '../../../providers/whitelabel.provider';
|
|
5
|
+
import { useTranslations } from 'next-intl';
|
|
5
6
|
|
|
6
7
|
interface BottomLink {
|
|
7
8
|
label: string;
|
|
@@ -17,6 +18,7 @@ function openFrillWidget() {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export function BottomLinks() {
|
|
21
|
+
const translate = useTranslations();
|
|
20
22
|
const { whitelabel } = useWhitelabel();
|
|
21
23
|
const isMainWhitelabel = useIsDefaultWhitelabel();
|
|
22
24
|
|
|
@@ -26,7 +28,7 @@ export function BottomLinks() {
|
|
|
26
28
|
...(isMainWhitelabel
|
|
27
29
|
? [
|
|
28
30
|
{
|
|
29
|
-
label: '
|
|
31
|
+
label: translate('common.navigation.bottomLinks.news'),
|
|
30
32
|
icon: IconStar,
|
|
31
33
|
className: 'novidades',
|
|
32
34
|
onClick: openFrillWidget,
|
|
@@ -34,14 +36,14 @@ export function BottomLinks() {
|
|
|
34
36
|
]
|
|
35
37
|
: []),
|
|
36
38
|
{
|
|
37
|
-
label: '
|
|
39
|
+
label: translate('common.navigation.bottomLinks.helpCenter'),
|
|
38
40
|
icon: IconHelp,
|
|
39
41
|
href: helpUrl,
|
|
40
42
|
},
|
|
41
43
|
...(isMainWhitelabel
|
|
42
44
|
? [
|
|
43
45
|
{
|
|
44
|
-
label: '
|
|
46
|
+
label: translate('common.navigation.bottomLinks.sendSuggestions'),
|
|
45
47
|
icon: IconBulb,
|
|
46
48
|
href: 'https://ideias.greatpages.com.br/b/y0geg1ve/feature-ideas',
|
|
47
49
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useAppNavigationContext } from '../AppNavigationContext';
|
|
4
4
|
import { Progress } from '../../../index';
|
|
5
|
+
import { useTranslations } from 'next-intl';
|
|
5
6
|
import { useBuyCreditsModal } from '../../../store/useBuyCreditsModal';
|
|
6
7
|
import { useCreditsDisabledModal } from '../../../store/useCreditsDisabledModal';
|
|
7
8
|
import { useAuth } from '../../../providers/auth.provider';
|
|
@@ -13,6 +14,7 @@ export interface CreditsCardProps {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
17
|
+
const translate = useTranslations();
|
|
16
18
|
const { breakpoint } = useAppNavigationContext();
|
|
17
19
|
const { openModal } = useBuyCreditsModal();
|
|
18
20
|
const { openModal: openDisabledModal } = useCreditsDisabledModal();
|
|
@@ -35,7 +37,7 @@ export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
|
35
37
|
onClick={handleClick}
|
|
36
38
|
>
|
|
37
39
|
<div className="flex items-center justify-between">
|
|
38
|
-
<span className="paragraph-xsmall-semibold text-white">
|
|
40
|
+
<span className="paragraph-xsmall-semibold text-white">{translate('common.navigation.creditsCard.label')}</span>
|
|
39
41
|
<span className="paragraph-xsmall-medium text-white/50">{used} / {total}</span>
|
|
40
42
|
</div>
|
|
41
43
|
<Progress className="bg-white/10 h-[6px]" indicatorColor="bg-white" value={Math.round((used / total) * 100)} />
|