@greatapps/common 1.1.676 → 1.1.678

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.
Files changed (243) hide show
  1. package/dist/components/account/ConfigurationsMyAccountModal.mjs +8 -6
  2. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
  3. package/dist/components/account/ConfirmDeleteAccountModal.mjs +20 -19
  4. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
  5. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +10 -11
  6. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
  7. package/dist/components/account/DeleteAccountModal.mjs +34 -28
  8. package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
  9. package/dist/components/account/DisableTwoFactorAuthModal.mjs +7 -5
  10. package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
  11. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -9
  12. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
  13. package/dist/components/account/TwoFactorAuthModal.mjs +22 -23
  14. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
  15. package/dist/components/account/constants.mjs +4 -4
  16. package/dist/components/account/constants.mjs.map +1 -1
  17. package/dist/components/account/hooks/useChangeEmailForm.mjs +5 -3
  18. package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
  19. package/dist/components/account/hooks/useChangePasswordForm.mjs +26 -3
  20. package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
  21. package/dist/components/account/hooks/useChangePhoneForm.mjs +18 -9
  22. package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
  23. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +26 -3
  24. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
  25. package/dist/components/account/hooks/useOtpVerification.mjs +19 -3
  26. package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
  27. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +27 -4
  28. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
  29. package/dist/components/account/sections/ChangeEmailModal.mjs +25 -28
  30. package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
  31. package/dist/components/account/sections/ChangePasswordSection.mjs +8 -6
  32. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
  33. package/dist/components/account/sections/ChangePhoneModal.mjs +24 -27
  34. package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
  35. package/dist/components/account/sections/MyProfileSection.mjs +37 -22
  36. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
  37. package/dist/components/account/sections/PreferencesSection.mjs +48 -24
  38. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
  39. package/dist/components/account/sections/SecuritySection.mjs +11 -9
  40. package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
  41. package/dist/components/account/sections/TokenSection.mjs +24 -8
  42. package/dist/components/account/sections/TokenSection.mjs.map +1 -1
  43. package/dist/components/layouts/NavBar.mjs +5 -3
  44. package/dist/components/layouts/NavBar.mjs.map +1 -1
  45. package/dist/components/layouts/NotificationsPopover.mjs +5 -3
  46. package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
  47. package/dist/components/layouts/ProfilePopover.mjs +6 -4
  48. package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
  49. package/dist/components/layouts/UsersSelectorPopover.mjs +9 -7
  50. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
  51. package/dist/components/modals/BuyCreditsModal.mjs +17 -18
  52. package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
  53. package/dist/components/modals/CreditsDisabledModal.mjs +6 -4
  54. package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
  55. package/dist/components/modals/PaidPlanRequiredModal.mjs +5 -3
  56. package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
  57. package/dist/components/modals/cards/AddCardModal.mjs +64 -46
  58. package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
  59. package/dist/components/modals/cards/CannotDeleteCardModal.mjs +9 -7
  60. package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
  61. package/dist/components/modals/cards/CardFormFields.mjs +65 -51
  62. package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
  63. package/dist/components/modals/cards/DeleteCardModal.mjs +10 -8
  64. package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
  65. package/dist/components/navigation/CancelledSubscriptionBanner.mjs +4 -2
  66. package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
  67. package/dist/components/navigation/OverdueInvoiceBanner.mjs +4 -2
  68. package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
  69. package/dist/components/navigation/PendingCancellationBanner.mjs +4 -6
  70. package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
  71. package/dist/components/navigation/ProjectSelectorPopover.mjs +8 -6
  72. package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
  73. package/dist/components/navigation/UpcomingInvoiceBanner.mjs +4 -6
  74. package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
  75. package/dist/components/navigation/subcomponents/BottomLinks.mjs +5 -3
  76. package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
  77. package/dist/components/navigation/subcomponents/CreditsCard.mjs +3 -1
  78. package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
  79. package/dist/components/navigation/subcomponents/PlanCard.mjs +3 -1
  80. package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
  81. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +5 -3
  82. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
  83. package/dist/components/pages/NotFoundPage.mjs +5 -3
  84. package/dist/components/pages/NotFoundPage.mjs.map +1 -1
  85. package/dist/components/pages/notifications/Notifications.mjs +13 -10
  86. package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
  87. package/dist/components/ui/buttons/CopyButton.mjs +9 -5
  88. package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
  89. package/dist/components/ui/data-display/CardItem.mjs +7 -5
  90. package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
  91. package/dist/components/ui/data-display/PaymentInfoCard.mjs +10 -8
  92. package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -1
  93. package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
  94. package/dist/components/ui/feedback/DefaultCircularProgress.mjs +3 -1
  95. package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
  96. package/dist/components/ui/form/ComboboxField.mjs +11 -6
  97. package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
  98. package/dist/components/ui/form/DatePicker.mjs +5 -2
  99. package/dist/components/ui/form/DatePicker.mjs.map +1 -1
  100. package/dist/components/ui/form/DateRangePicker.mjs +5 -2
  101. package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
  102. package/dist/components/ui/form/PhoneInput.mjs +5 -3
  103. package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
  104. package/dist/components/ui/form/SelectField.mjs +6 -3
  105. package/dist/components/ui/form/SelectField.mjs.map +1 -1
  106. package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +11 -18
  107. package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
  108. package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +6 -15
  109. package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
  110. package/dist/i18n/config.mjs +13 -0
  111. package/dist/i18n/config.mjs.map +1 -0
  112. package/dist/i18n/country-language.mjs +74 -0
  113. package/dist/i18n/country-language.mjs.map +1 -0
  114. package/dist/i18n/messages/en-us.mjs +495 -0
  115. package/dist/i18n/messages/en-us.mjs.map +1 -0
  116. package/dist/i18n/messages/es-es.mjs +495 -0
  117. package/dist/i18n/messages/es-es.mjs.map +1 -0
  118. package/dist/i18n/messages/index.mjs +16 -0
  119. package/dist/i18n/messages/index.mjs.map +1 -0
  120. package/dist/i18n/messages/pt-br.mjs +508 -0
  121. package/dist/i18n/messages/pt-br.mjs.map +1 -0
  122. package/dist/i18n/normalize.mjs +12 -0
  123. package/dist/i18n/normalize.mjs.map +1 -0
  124. package/dist/i18n/resolve-locale.mjs +42 -0
  125. package/dist/i18n/resolve-locale.mjs.map +1 -0
  126. package/dist/i18n.mjs +14 -0
  127. package/dist/i18n.mjs.map +1 -0
  128. package/dist/index.mjs +19 -3
  129. package/dist/index.mjs.map +1 -1
  130. package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +20 -0
  131. package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +1 -0
  132. package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +2 -1
  133. package/dist/modules/cards/hooks/handle-delete-card.hook.mjs.map +1 -1
  134. package/dist/modules/images/utils/validate-image.mjs +8 -8
  135. package/dist/modules/images/utils/validate-image.mjs.map +1 -1
  136. package/dist/modules/plans/handlers/list-plans.handler.mjs +1 -1
  137. package/dist/modules/plans/handlers/list-plans.handler.mjs.map +1 -1
  138. package/dist/modules/plans/hooks/list-plans.hook.mjs +2 -2
  139. package/dist/modules/plans/hooks/list-plans.hook.mjs.map +1 -1
  140. package/dist/modules/plans/services/plans.service.mjs +1 -1
  141. package/dist/modules/plans/services/plans.service.mjs.map +1 -1
  142. package/dist/modules/plans/types/plan.type.mjs +9 -2
  143. package/dist/modules/plans/types/plan.type.mjs.map +1 -1
  144. package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +66 -34
  145. package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
  146. package/dist/modules/projects/services/projects.service.mjs +9 -0
  147. package/dist/modules/projects/services/projects.service.mjs.map +1 -1
  148. package/dist/modules/subscriptions/utils/periodicity.mjs +20 -14
  149. package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
  150. package/dist/providers/auth.provider.mjs +9 -1
  151. package/dist/providers/auth.provider.mjs.map +1 -1
  152. package/dist/server.mjs +2 -0
  153. package/dist/server.mjs.map +1 -1
  154. package/dist/utils/format/currency.mjs +32 -4
  155. package/dist/utils/format/currency.mjs.map +1 -1
  156. package/dist/utils/intl/cookie-domain.mjs +17 -0
  157. package/dist/utils/intl/cookie-domain.mjs.map +1 -0
  158. package/dist/utils/intl/locale-cookie.mjs +13 -0
  159. package/dist/utils/intl/locale-cookie.mjs.map +1 -0
  160. package/dist/utils/intl/locales.mjs +3 -2
  161. package/dist/utils/intl/locales.mjs.map +1 -1
  162. package/package.json +7 -1
  163. package/src/components/account/ConfigurationsMyAccountModal.tsx +10 -6
  164. package/src/components/account/ConfirmDeleteAccountModal.tsx +22 -13
  165. package/src/components/account/ConfirmGlobalPreferencesModal.tsx +12 -10
  166. package/src/components/account/DeleteAccountModal.tsx +34 -24
  167. package/src/components/account/DisableTwoFactorAuthModal.tsx +11 -6
  168. package/src/components/account/IsntPossibleDeleteAccountModal.tsx +8 -6
  169. package/src/components/account/TwoFactorAuthModal.tsx +33 -29
  170. package/src/components/account/constants.ts +8 -5
  171. package/src/components/account/hooks/useChangeEmailForm.tsx +5 -3
  172. package/src/components/account/hooks/useChangePasswordForm.tsx +20 -6
  173. package/src/components/account/hooks/useChangePhoneForm.tsx +16 -10
  174. package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +20 -6
  175. package/src/components/account/hooks/useOtpVerification.tsx +16 -4
  176. package/src/components/account/hooks/useTwoFactorAuthForm.tsx +21 -7
  177. package/src/components/account/sections/ChangeEmailModal.tsx +35 -21
  178. package/src/components/account/sections/ChangePasswordSection.tsx +10 -6
  179. package/src/components/account/sections/ChangePhoneModal.tsx +50 -22
  180. package/src/components/account/sections/MyProfileSection.tsx +37 -23
  181. package/src/components/account/sections/PreferencesSection.tsx +52 -25
  182. package/src/components/account/sections/SecuritySection.tsx +19 -10
  183. package/src/components/account/sections/TokenSection.tsx +22 -10
  184. package/src/components/layouts/NavBar.tsx +5 -3
  185. package/src/components/layouts/NotificationsPopover.tsx +5 -3
  186. package/src/components/layouts/ProfilePopover.tsx +6 -4
  187. package/src/components/layouts/UsersSelectorPopover.tsx +9 -7
  188. package/src/components/modals/BuyCreditsModal.tsx +18 -16
  189. package/src/components/modals/CreditsDisabledModal.tsx +6 -6
  190. package/src/components/modals/PaidPlanRequiredModal.tsx +5 -3
  191. package/src/components/modals/cards/AddCardModal.tsx +89 -62
  192. package/src/components/modals/cards/CannotDeleteCardModal.tsx +9 -8
  193. package/src/components/modals/cards/CardFormFields.tsx +93 -75
  194. package/src/components/modals/cards/DeleteCardModal.tsx +10 -8
  195. package/src/components/navigation/CancelledSubscriptionBanner.tsx +4 -2
  196. package/src/components/navigation/OverdueInvoiceBanner.tsx +4 -2
  197. package/src/components/navigation/PendingCancellationBanner.tsx +4 -2
  198. package/src/components/navigation/ProjectSelectorPopover.tsx +8 -6
  199. package/src/components/navigation/UpcomingInvoiceBanner.tsx +4 -2
  200. package/src/components/navigation/subcomponents/BottomLinks.tsx +5 -3
  201. package/src/components/navigation/subcomponents/CreditsCard.tsx +3 -1
  202. package/src/components/navigation/subcomponents/PlanCard.tsx +3 -1
  203. package/src/components/navigation/subcomponents/ProjectSelector.tsx +5 -3
  204. package/src/components/pages/NotFoundPage.tsx +5 -3
  205. package/src/components/pages/notifications/Notifications.tsx +13 -10
  206. package/src/components/ui/buttons/CopyButton.tsx +10 -5
  207. package/src/components/ui/data-display/CardItem.tsx +7 -5
  208. package/src/components/ui/data-display/PaymentInfoCard.tsx +10 -8
  209. package/src/components/ui/feedback/CircularProgress.tsx +4 -0
  210. package/src/components/ui/feedback/DefaultCircularProgress.tsx +3 -1
  211. package/src/components/ui/form/ComboboxField.tsx +11 -6
  212. package/src/components/ui/form/DatePicker.tsx +5 -2
  213. package/src/components/ui/form/DateRangePicker.tsx +5 -2
  214. package/src/components/ui/form/PhoneInput.tsx +5 -3
  215. package/src/components/ui/form/SelectField.tsx +6 -3
  216. package/src/components/widgets/ImageUpload/ImageCropModal.tsx +19 -11
  217. package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +6 -5
  218. package/src/i18n/config.ts +17 -0
  219. package/src/i18n/country-language.ts +60 -0
  220. package/src/i18n/messages/en-us.ts +515 -0
  221. package/src/i18n/messages/es-es.ts +516 -0
  222. package/src/i18n/messages/index.ts +24 -0
  223. package/src/i18n/messages/pt-br.ts +539 -0
  224. package/src/i18n/normalize.ts +15 -0
  225. package/src/i18n/resolve-locale.ts +77 -0
  226. package/src/i18n.ts +10 -0
  227. package/src/index.ts +13 -2
  228. package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +32 -0
  229. package/src/modules/cards/hooks/handle-delete-card.hook.ts +8 -3
  230. package/src/modules/images/utils/validate-image.ts +23 -8
  231. package/src/modules/plans/handlers/list-plans.handler.ts +1 -1
  232. package/src/modules/plans/hooks/list-plans.hook.ts +2 -2
  233. package/src/modules/plans/services/plans.service.ts +1 -1
  234. package/src/modules/plans/types/plan.type.ts +9 -1
  235. package/src/modules/plans/utils/map-api-plan-to-ui.ts +115 -46
  236. package/src/modules/projects/services/projects.service.ts +12 -0
  237. package/src/modules/subscriptions/utils/periodicity.ts +29 -12
  238. package/src/providers/auth.provider.tsx +13 -1
  239. package/src/server.ts +2 -0
  240. package/src/utils/format/currency.ts +62 -7
  241. package/src/utils/intl/cookie-domain.ts +29 -0
  242. package/src/utils/intl/locale-cookie.ts +18 -0
  243. package/src/utils/intl/locales.ts +3 -2
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { IconCheck, IconCopy, IconInfoCircle } from '@tabler/icons-react';
4
+ import { useTranslations } from 'next-intl';
4
5
  import { toast } from 'sonner';
5
6
  import { Toast } from '../../ui/feedback/Toast';
6
7
  import { Button } from '../../ui/buttons/Button';
@@ -10,31 +11,42 @@ import { useAccountToken } from '../../../modules/accounts/hooks/use-account-tok
10
11
  import { useIsDefaultWhitelabel } from '../../../providers/whitelabel.provider';
11
12
 
12
13
  export function TokenSection() {
14
+ const translate = useTranslations();
13
15
  const { data: token = '', isLoading } = useAccountToken();
14
16
  const isDefaultWl = useIsDefaultWhitelabel();
15
17
 
16
18
  const { isCopied, copy } = useCopyToClipboard({
17
19
  onSuccess: () => {
18
- toast.custom((t) => (
19
- <Toast variant="success" message="Token copiado com sucesso" toastId={t} />
20
+ toast.custom((toastId) => (
21
+ <Toast
22
+ variant="success"
23
+ message={translate('common.account.token.copySuccess')}
24
+ toastId={toastId}
25
+ />
20
26
  ));
21
27
  },
22
28
  onError: () => {
23
- toast.custom((t) => (
24
- <Toast variant="error" message="Não foi possível copiar o token" toastId={t} />
29
+ toast.custom((toastId) => (
30
+ <Toast
31
+ variant="error"
32
+ message={translate('common.account.token.copyError')}
33
+ toastId={toastId}
34
+ />
25
35
  ));
26
36
  },
27
37
  });
28
38
 
29
39
  return (
30
40
  <div className="h-full overflow-y-auto overscroll-contain px-4 pb-20 lg:p-5 lg:pt-5 flex flex-col gap-5 lg:gap-6 lg:pb-31 lg:overscroll-auto">
31
- <span className="paragraph-medium-semibold text-gray-950">Token da conta</span>
41
+ <span className="paragraph-medium-semibold text-gray-950">
42
+ {translate('common.account.token.title')}
43
+ </span>
32
44
 
33
45
  <div className="flex flex-col gap-3">
34
46
  <div className="flex items-end gap-3">
35
47
  <FormField
36
- label="Token"
37
- value={isLoading ? 'Carregando...' : token}
48
+ label={translate('common.account.token.label')}
49
+ value={isLoading ? translate('common.actions.loading') : token}
38
50
  disabled
39
51
  readOnly
40
52
  classnameContainer="bg-gray-50 cursor-default opacity-100!"
@@ -48,14 +60,14 @@ export function TokenSection() {
48
60
  disabled={isLoading || !token}
49
61
  >
50
62
  {isCopied ? <IconCheck size={16} /> : <IconCopy size={16} />}
51
- {isCopied ? 'Copiado' : 'Copiar'}
63
+ {isCopied ? translate('common.actions.copied') : translate('common.actions.copy')}
52
64
  </Button>
53
65
  </div>
54
66
 
55
67
  <div className={`flex items-center gap-3 p-4 rounded-lg ${isDefaultWl ? 'bg-cyan-50' : 'bg-zinc-50'}`}>
56
68
  <IconInfoCircle className="size-4 text-zinc-950 shrink-0" />
57
69
  <span className="paragraph-small-regular text-zinc-950 max-w-[420px]">
58
- Este token é exclusivo da sua conta e permite acesso à API. Não compartilhe com terceiros.
70
+ {translate('common.account.token.info')}
59
71
  </span>
60
72
  </div>
61
73
 
@@ -65,7 +77,7 @@ export function TokenSection() {
65
77
  rel="noopener noreferrer"
66
78
  className="paragraph-small-medium text-gray-500 underline hover:text-gray-700 transition-colors w-fit"
67
79
  >
68
- Acessar a documentação
80
+ {translate('common.account.token.docsLink')}
69
81
  </a>
70
82
  </div>
71
83
  </div>
@@ -3,6 +3,7 @@
3
3
  import * as React from "react";
4
4
  import Image from "next/image";
5
5
  import Link from "next/link";
6
+ import { useTranslations } from "next-intl";
6
7
  import { IconChevronRight } from "@tabler/icons-react";
7
8
  import { Separator } from "../ui/data-display/Separator";
8
9
  import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
@@ -35,6 +36,7 @@ function NavBar({
35
36
  children,
36
37
  className,
37
38
  }: NavBarProps) {
39
+ const translate = useTranslations();
38
40
  const { isExpanded: isDesktopExpanded, toggle: toggleDesktop } =
39
41
  useDesktopSidebarStore();
40
42
  useDesktopSidebarHydration();
@@ -128,7 +130,7 @@ function NavBar({
128
130
  <IconChevronRight size={16} className="text-gray-500" />
129
131
  </button>
130
132
  </TooltipTrigger>
131
- <TooltipContent side="right">Expandir menu</TooltipContent>
133
+ <TooltipContent side="right">{translate('common.layout.navbar.expandMenu')}</TooltipContent>
132
134
  </Tooltip>
133
135
  )}
134
136
  {/* Desktop expand button */}
@@ -142,7 +144,7 @@ function NavBar({
142
144
  <IconChevronRight size={16} className="text-gray-500" />
143
145
  </button>
144
146
  </TooltipTrigger>
145
- <TooltipContent side="right">Expandir menu</TooltipContent>
147
+ <TooltipContent side="right">{translate('common.layout.navbar.expandMenu')}</TooltipContent>
146
148
  </Tooltip>
147
149
  )}
148
150
  </div>
@@ -203,7 +205,7 @@ function NavBar({
203
205
  </Link>
204
206
  </TooltipTrigger>
205
207
  <TooltipContent side="right">
206
- {isDefaultWl ? "GreatPages" : "Páginas"}
208
+ {isDefaultWl ? translate('common.layout.navbar.greatPages') : translate('common.layout.navbar.pages')}
207
209
  </TooltipContent>
208
210
  </Tooltip>
209
211
  <div
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useState } from "react";
4
+ import { useTranslations } from "next-intl";
4
5
  import { IconBell } from '@tabler/icons-react';
5
6
  import * as PopoverPrimitive from "@radix-ui/react-popover";
6
7
  import { Popover } from "../ui/overlay/Popover";
@@ -27,6 +28,7 @@ function NotificationsPopover({
27
28
  contentClassName,
28
29
  badgeClassName,
29
30
  }: NotificationsPopoverProps) {
31
+ const translate = useTranslations();
30
32
  const isDefaultWl = useIsDefaultWhitelabel();
31
33
  const resolvedBadgeClassName = badgeClassName ?? (isDefaultWl ? "bg-cyan-300" : "bg-zinc-300");
32
34
  const [open, setOpen] = useState(false);
@@ -71,7 +73,7 @@ function NotificationsPopover({
71
73
  sideOffset={8}
72
74
  >
73
75
  <span className="paragraph-small-semibold text-gray-950 px-4">
74
- Últimas notificações
76
+ {translate('common.notifications.popover.title')}
75
77
  </span>
76
78
 
77
79
  {messages.length > 0 ? (
@@ -95,7 +97,7 @@ function NotificationsPopover({
95
97
  <IconBell size={20} color="var(--color-gray-950)" />
96
98
  </div>
97
99
  <span className="paragraph-small-medium text-gray-950">
98
- Sem notificações por enquanto
100
+ {translate('common.notifications.popover.empty')}
99
101
  </span>
100
102
  </div>
101
103
  )}
@@ -106,7 +108,7 @@ function NotificationsPopover({
106
108
  className="h-8! mt-2 mb-4 mx-4 paragraph-small-semibold"
107
109
  onClick={onViewAll}
108
110
  >
109
- Todas as notificações
111
+ {translate('common.notifications.popover.viewAll')}
110
112
  </Button>
111
113
  )}
112
114
  </PopoverPrimitive.Content>
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useState } from "react";
4
+ import { useTranslations } from "next-intl";
4
5
  import { useRouter } from "next/navigation";
5
6
  import * as PopoverPrimitive from "@radix-ui/react-popover";
6
7
  import { Popover } from "../ui/overlay/Popover";
@@ -36,6 +37,7 @@ function ProfilePopover({
36
37
  contentClassName = "absolute bottom-2 left-[26px]",
37
38
  menuItems = [],
38
39
  }: ProfilePopoverProps) {
40
+ const translate = useTranslations();
39
41
  const { user, logout } = useAuth();
40
42
  const [isLoggingOut, setIsLoggingOut] = useState(false);
41
43
  const [popoverOpen, setPopoverOpen] = useState(false);
@@ -68,7 +70,7 @@ function ProfilePopover({
68
70
  <>
69
71
  <LoadingOverlay
70
72
  isLoading={isLoggingOut}
71
- message="Saindo da sua conta..."
73
+ message={translate('common.layout.profile.loggingOut')}
72
74
  />
73
75
  <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
74
76
  <PopoverPrimitive.Trigger className="cursor-pointer">
@@ -124,7 +126,7 @@ function ProfilePopover({
124
126
  }
125
127
  }}
126
128
  >
127
- Editar
129
+ {translate('common.actions.edit')}
128
130
  </Button>
129
131
  </div>
130
132
 
@@ -146,7 +148,7 @@ function ProfilePopover({
146
148
  >
147
149
  <div className="flex items-center justify-between gap-2">
148
150
  <span className="paragraph-xsmall-semibold text-white truncate">
149
- Créditos usados
151
+ {translate('common.layout.profile.usedCredits')}
150
152
  </span>
151
153
  <span className="paragraph-xsmall-medium text-white/50">
152
154
  {summary.usedCredits.toLocaleString("pt-BR")}/
@@ -173,7 +175,7 @@ function ProfilePopover({
173
175
  ))}
174
176
  </div>
175
177
  <Separator />
176
- <NavBarItem label="Sair" onClick={handleLogout} />
178
+ <NavBarItem label={translate('common.layout.profile.logout')} onClick={handleLogout} />
177
179
  </div>
178
180
  </div>
179
181
  </PopoverPrimitive.Content>
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useEffect, useState } from "react";
4
+ import { useTranslations } from "next-intl";
4
5
  import { IconPlus, IconUser, IconUsers } from '@tabler/icons-react';
5
6
  import { UserAvatar } from "../ui/data-display/UserAvatar";
6
7
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/overlay/Popover";
@@ -46,6 +47,7 @@ export function UsersSelectorPopover({
46
47
  align,
47
48
  contentClassName,
48
49
  }: UsersSelectorPopoverProps) {
50
+ const translate = useTranslations();
49
51
  const { accountsUrl } = useWhitelabelUrls();
50
52
  const [open, setOpen] = useState(false);
51
53
  const [hoveredId, setHoveredId] = useState<number | null>(null);
@@ -108,7 +110,7 @@ export function UsersSelectorPopover({
108
110
  >
109
111
  <div className="flex flex-col p-3 gap-2">
110
112
  <div className="flex items-center justify-between">
111
- <span className="paragraph-small-semibold">Usuários</span>
113
+ <span className="paragraph-small-semibold">{translate('common.layout.usersSelector.title')}</span>
112
114
  <div className="flex items-center gap-1.5">
113
115
  <Button
114
116
  variant="secondary"
@@ -118,14 +120,14 @@ export function UsersSelectorPopover({
118
120
  }}
119
121
  >
120
122
  <IconPlus size={16} />
121
- Adicionar
123
+ {translate('common.layout.usersSelector.add')}
122
124
  </Button>
123
125
  </div>
124
126
  </div>
125
127
 
126
128
  <Command shouldFilter={false} className="gap-2" value="">
127
129
  <CommandInput
128
- placeholder="Busque aqui"
130
+ placeholder={translate('common.layout.usersSelector.searchPlaceholder')}
129
131
  value={searchInput}
130
132
  onValueChange={setSearchInput}
131
133
  />
@@ -143,12 +145,12 @@ export function UsersSelectorPopover({
143
145
  <div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
144
146
  <IconUsers size={28} className="text-gray-300" />
145
147
  <span className="paragraph-small-medium text-center text-gray-500">
146
- Nenhum usuário encontrado.
148
+ {translate('common.layout.usersSelector.empty')}
147
149
  </span>
148
150
  </div>
149
151
  ) : (
150
152
  <>
151
- <CommandEmpty>Nenhum resultado encontrado.</CommandEmpty>
153
+ <CommandEmpty>{translate('common.layout.usersSelector.noResults')}</CommandEmpty>
152
154
  {allUsers.map((user) => {
153
155
  const inProject = user.in_project ?? false;
154
156
  const removable =
@@ -200,7 +202,7 @@ export function UsersSelectorPopover({
200
202
  </div>
201
203
  </TooltipTrigger>
202
204
  <TooltipContent className="z-[1002]">
203
- {inProject ? "Remover do projeto" : "Adicionar ao projeto"}
205
+ {inProject ? translate('common.layout.usersSelector.removeFromProject') : translate('common.layout.usersSelector.addToProject')}
204
206
  </TooltipContent>
205
207
  </Tooltip>
206
208
  </div>
@@ -225,7 +227,7 @@ export function UsersSelectorPopover({
225
227
  window.location.href = `${accountsUrl}/my-teams`;
226
228
  }}
227
229
  >
228
- Gerenciar equipe
230
+ {translate('common.layout.usersSelector.manageTeam')}
229
231
  </Button>
230
232
  </div>
231
233
  </PopoverContent>
@@ -26,6 +26,7 @@ import { useUpdateSubscriptionPlan } from '../../modules/subscriptions/hooks/upd
26
26
  import { getPriceFromCalculatedData } from '../../modules/subscriptions/utils/periodicity';
27
27
  import { useIsDefaultWhitelabel, useExternalContracting } from '../../providers/whitelabel.provider';
28
28
  import { IconInfoCircle, IconX, IconLoader2, IconSparkles } from '@tabler/icons-react';
29
+ import { useTranslations } from 'next-intl';
29
30
  import { useCallback, useEffect, useMemo, useRef } from 'react';
30
31
  import { useForm } from 'react-hook-form';
31
32
  import { zodResolver } from '@hookform/resolvers/zod';
@@ -42,6 +43,7 @@ const buyCreditSchema = z.object({
42
43
  type BuyCreditFormData = z.infer<typeof buyCreditSchema>;
43
44
 
44
45
  export default function BuyCreditsModal() {
46
+ const translate = useTranslations();
45
47
  const { open, closeModal } = useBuyCreditsModal();
46
48
  const { openModal } = useModalManager();
47
49
  const isDefaultWl = useIsDefaultWhitelabel();
@@ -186,12 +188,12 @@ export default function BuyCreditsModal() {
186
188
  label: (
187
189
  <div className="flex items-center justify-between gap-2 w-full">
188
190
  <span className="paragraph-small-medium text-zinc-950 flex-1">
189
- {opt.credits.toLocaleString('pt-BR')} créditos de IA
191
+ {translate('common.credits.buy.creditsOptionLabel', { credits: opt.credits.toLocaleString('pt-BR') })}
190
192
  </span>
191
193
  <span className="paragraph-small-medium text-zinc-500 opacity-70">{opt.priceLabel}</span>
192
194
  </div>
193
195
  ),
194
- displayValue: `${opt.credits.toLocaleString('pt-BR')} créditos de IA`,
196
+ displayValue: translate('common.credits.buy.creditsOptionDisplayValue', { credits: opt.credits.toLocaleString('pt-BR') }),
195
197
  }));
196
198
  }, []);
197
199
 
@@ -217,7 +219,7 @@ export default function BuyCreditsModal() {
217
219
  toast.custom((t) => (
218
220
  <Toast
219
221
  variant="success"
220
- message={`Créditos de IA alterados para ${data.creditOption.toLocaleString('pt-BR')}`}
222
+ message={translate('common.credits.buy.creditsChangedToast', { credits: data.creditOption.toLocaleString('pt-BR') })}
221
223
  toastId={t}
222
224
  />
223
225
  ));
@@ -234,7 +236,7 @@ export default function BuyCreditsModal() {
234
236
  if (totalPrice !== null) {
235
237
  return (
236
238
  <span className="paragraph-xlarge-semibold text-zinc-950">
237
- {totalPrice === 0 ? 'Padrão' : formatPrice(totalPrice)}
239
+ {totalPrice === 0 ? translate('common.credits.buy.defaultPrice') : formatPrice(totalPrice)}
238
240
  </span>
239
241
  );
240
242
  }
@@ -251,10 +253,10 @@ export default function BuyCreditsModal() {
251
253
  </div>
252
254
  <div className="flex flex-col gap-2">
253
255
  <DialogTitle className="paragraph-medium-semibold text-zinc-950">
254
- Créditos de IA
256
+ {translate('common.credits.buy.externalTitle')}
255
257
  </DialogTitle>
256
258
  <span className="paragraph-small-regular text-zinc-600">
257
- Para adquirir créditos de IA, acesse sua área de assinatura.
259
+ {translate('common.credits.buy.externalDescription')}
258
260
  </span>
259
261
  </div>
260
262
  </DialogHeader>
@@ -266,7 +268,7 @@ export default function BuyCreditsModal() {
266
268
  redirectToExternal('contracting');
267
269
  }}
268
270
  >
269
- Acessar área de assinatura
271
+ {translate('common.credits.buy.externalButton')}
270
272
  </Button>
271
273
  </div>
272
274
  </DialogContent>
@@ -282,7 +284,7 @@ export default function BuyCreditsModal() {
282
284
  >
283
285
  <DialogHeader className="px-4 py-3 border-b border-zinc-200 shrink-0 relative">
284
286
  <DialogTitle className="paragraph-medium-semibold text-zinc-950 text-center">
285
- Comprar créditos de IA
287
+ {translate('common.credits.buy.title')}
286
288
  </DialogTitle>
287
289
  <button
288
290
  type="button"
@@ -319,8 +321,8 @@ export default function BuyCreditsModal() {
319
321
  <IconInfoCircle className="size-4 text-zinc-950 shrink-0" />
320
322
  <span className="paragraph-small-regular text-zinc-950">
321
323
  {isIncreasingCredits
322
- ? 'O pagamento será processado no momento da confirmação.'
323
- : 'As alterações entrarão em vigor a partir da sua próxima fatura.'}
324
+ ? translate('common.credits.buy.paymentOnConfirm')
325
+ : translate('common.credits.buy.nextInvoiceChanges')}
324
326
  </span>
325
327
  </div>
326
328
  )}
@@ -331,7 +333,7 @@ export default function BuyCreditsModal() {
331
333
  <div className="hidden lg:flex flex-col gap-2">
332
334
  {immediateChargeTotal !== null && immediateChargeTotal > 0 && (
333
335
  <div className="flex items-center justify-between">
334
- <span className="paragraph-xsmall-medium text-zinc-500">Cobrança imediata</span>
336
+ <span className="paragraph-xsmall-medium text-zinc-500">{translate('common.credits.buy.immediateCharge')}</span>
335
337
  {isCalculatePending ? (
336
338
  <Skeleton className="h-5 w-20" />
337
339
  ) : (
@@ -342,7 +344,7 @@ export default function BuyCreditsModal() {
342
344
  </div>
343
345
  )}
344
346
  <div className="flex items-center justify-between">
345
- <span className="paragraph-small-medium text-zinc-500">Valor total do plano</span>
347
+ <span className="paragraph-small-medium text-zinc-500">{translate('common.credits.buy.totalPlanValue')}</span>
346
348
  {renderPriceDisplay()}
347
349
  </div>
348
350
  </div>
@@ -353,7 +355,7 @@ export default function BuyCreditsModal() {
353
355
  className="w-full hidden lg:inline-flex"
354
356
  >
355
357
  {isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
356
- Confirmar e pagar
358
+ {translate('common.credits.buy.confirmAndPay')}
357
359
  </Button>
358
360
  </div>
359
361
 
@@ -361,7 +363,7 @@ export default function BuyCreditsModal() {
361
363
  <div className="flex flex-col gap-2">
362
364
  {immediateChargeTotal !== null && immediateChargeTotal > 0 && (
363
365
  <div className="flex items-center justify-between">
364
- <span className="paragraph-xsmall-medium text-zinc-500">Cobrança imediata</span>
366
+ <span className="paragraph-xsmall-medium text-zinc-500">{translate('common.credits.buy.immediateCharge')}</span>
365
367
  {isCalculatePending ? (
366
368
  <Skeleton className="h-5 w-20" />
367
369
  ) : (
@@ -372,13 +374,13 @@ export default function BuyCreditsModal() {
372
374
  </div>
373
375
  )}
374
376
  <div className="flex items-center justify-between">
375
- <span className="paragraph-small-medium text-zinc-500">Valor total do plano</span>
377
+ <span className="paragraph-small-medium text-zinc-500">{translate('common.credits.buy.totalPlanValue')}</span>
376
378
  {renderPriceDisplay()}
377
379
  </div>
378
380
  </div>
379
381
  <Button type="submit" disabled={isConfirmDisabled} className="w-full">
380
382
  {isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
381
- Confirmar e pagar
383
+ {translate('common.credits.buy.confirmAndPay')}
382
384
  </Button>
383
385
  </div>
384
386
  </form>
@@ -10,9 +10,11 @@ import {
10
10
  import { Button } from '../ui/buttons/Button';
11
11
  import { Separator } from '../ui/data-display/Separator';
12
12
  import { IconAlertTriangle } from '@tabler/icons-react';
13
+ import { useTranslations } from 'next-intl';
13
14
  import { useCreditsDisabledModal } from '../../store/useCreditsDisabledModal';
14
15
 
15
16
  export default function CreditsDisabledModal() {
17
+ const translate = useTranslations();
16
18
  const { open, closeModal } = useCreditsDisabledModal();
17
19
 
18
20
  return (
@@ -32,14 +34,12 @@ export default function CreditsDisabledModal() {
32
34
  </div>
33
35
  <div className="flex flex-col gap-2">
34
36
  <DialogTitle className="paragraph-medium-semibold text-zinc-950">
35
- Compra de créditos indisponível
37
+ {translate('common.credits.disabled.title')}
36
38
  </DialogTitle>
37
39
  <DialogDescription className="paragraph-small-regular text-zinc-600" asChild>
38
40
  <div className="flex flex-col gap-3">
39
- <p>Apenas administradores e proprietários podem comprar créditos de IA.</p>
40
- <p>
41
- Peça a um administrador ou proprietário da conta para adquirir mais créditos.
42
- </p>
41
+ <p>{translate('common.credits.disabled.descriptionLine1')}</p>
42
+ <p>{translate('common.credits.disabled.descriptionLine2')}</p>
43
43
  </div>
44
44
  </DialogDescription>
45
45
  </div>
@@ -53,7 +53,7 @@ export default function CreditsDisabledModal() {
53
53
  className="h-10! transition-colors"
54
54
  onClick={() => closeModal()}
55
55
  >
56
- Entendi
56
+ {translate('common.credits.disabled.understood')}
57
57
  </Button>
58
58
  </div>
59
59
  </DialogContent>
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { IconLock } from '@tabler/icons-react';
4
+ import { useTranslations } from 'next-intl';
4
5
  import { Button } from '../ui/buttons/Button';
5
6
  import {
6
7
  Dialog,
@@ -14,14 +15,15 @@ import { useModalManager } from '../../store/useModalManager';
14
15
  import type { ModalData } from '../../store/useModalManager';
15
16
 
16
17
  export default function PaidPlanRequiredModal() {
18
+ const translate = useTranslations();
17
19
  const { activeModal, modalData, closeModal } = useModalManager();
18
20
  const isOpen = activeModal === 'paidPlanRequiredModal';
19
21
  const data = modalData as ModalData & { title?: string; description?: string };
20
22
  const { accountsUrl } = useWhitelabelUrls();
21
23
  const { redirectToExternal } = useExternalContracting();
22
24
 
23
- const title = (data.title as string) ?? "Recurso disponível em planos pagos";
24
- const description = (data.description as string) ?? "Para acessar este recurso, faça upgrade para um plano pago";
25
+ const title = (data.title as string) ?? translate('common.credits.paidPlanRequired.defaultTitle');
26
+ const description = (data.description as string) ?? translate('common.credits.paidPlanRequired.defaultDescription');
25
27
 
26
28
  const handleKnowPlans = () => {
27
29
  if (redirectToExternal('plans')) return;
@@ -49,7 +51,7 @@ export default function PaidPlanRequiredModal() {
49
51
  className="w-fit h-10!"
50
52
  onClick={handleKnowPlans}
51
53
  >
52
- Conhecer planos
54
+ {translate('common.credits.paidPlanRequired.knowPlans')}
53
55
  </Button>
54
56
  </div>
55
57
  </DialogContent>