@greatapps/common 1.1.674 → 1.1.675
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 +6 -8
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +19 -20
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +11 -10
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +28 -34
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +5 -7
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +9 -8
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +23 -22
- 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 +3 -5
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +3 -26
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +9 -18
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +3 -26
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +3 -19
- package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +4 -27
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +28 -25
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +6 -8
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +27 -24
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +22 -37
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +24 -48
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/SecuritySection.mjs +9 -11
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/TokenSection.mjs +8 -24
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +148 -2
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs +3 -5
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +3 -5
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +4 -6
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +7 -9
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/BuyCreditsModal.mjs +18 -17
- package/dist/components/modals/BuyCreditsModal.mjs.map +1 -1
- package/dist/components/modals/CreditsDisabledModal.mjs +4 -6
- package/dist/components/modals/CreditsDisabledModal.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +3 -5
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs +24 -27
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs +7 -9
- package/dist/components/modals/cards/CannotDeleteCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs +22 -25
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/modals/cards/DeleteCardModal.mjs +8 -10
- package/dist/components/modals/cards/DeleteCardModal.mjs.map +1 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +2 -4
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -1
- package/dist/components/navigation/OverdueInvoiceBanner.mjs +2 -4
- package/dist/components/navigation/OverdueInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/PendingCancellationBanner.mjs +6 -4
- package/dist/components/navigation/PendingCancellationBanner.mjs.map +1 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +6 -8
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -1
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs +6 -4
- package/dist/components/navigation/UpcomingInvoiceBanner.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +3 -5
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +1 -3
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +1 -3
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +3 -5
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/NotFoundPage.mjs +3 -5
- package/dist/components/pages/NotFoundPage.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +10 -13
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs +5 -9
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +5 -7
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentInfoCard.mjs +8 -10
- 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 +1 -3
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/form/ComboboxField.mjs +6 -11
- package/dist/components/ui/form/ComboboxField.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs +2 -5
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs +2 -5
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/PhoneInput.mjs +3 -5
- package/dist/components/ui/form/PhoneInput.mjs.map +1 -1
- package/dist/components/ui/form/SelectField.mjs +3 -6
- package/dist/components/ui/form/SelectField.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +18 -11
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +1 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +15 -6
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +1 -1
- package/dist/index.mjs +2 -16
- package/dist/index.mjs.map +1 -1
- package/dist/modules/cards/hooks/handle-delete-card.hook.mjs +1 -2
- 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/types/plan.type.mjs +0 -3
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +34 -56
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs +14 -20
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/providers/auth.provider.mjs +1 -9
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/server.mjs +0 -2
- package/dist/server.mjs.map +1 -1
- package/dist/utils/format/currency.mjs +4 -32
- package/dist/utils/format/currency.mjs.map +1 -1
- package/dist/utils/intl/locales.mjs +2 -3
- package/dist/utils/intl/locales.mjs.map +1 -1
- package/package.json +1 -7
- package/src/components/account/ConfigurationsMyAccountModal.tsx +6 -10
- package/src/components/account/ConfirmDeleteAccountModal.tsx +13 -22
- package/src/components/account/ConfirmGlobalPreferencesModal.tsx +10 -12
- package/src/components/account/DeleteAccountModal.tsx +24 -34
- package/src/components/account/DisableTwoFactorAuthModal.tsx +6 -11
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +6 -8
- package/src/components/account/TwoFactorAuthModal.tsx +29 -33
- package/src/components/account/constants.ts +5 -8
- package/src/components/account/hooks/useChangeEmailForm.tsx +3 -5
- package/src/components/account/hooks/useChangePasswordForm.tsx +6 -20
- package/src/components/account/hooks/useChangePhoneForm.tsx +10 -16
- package/src/components/account/hooks/useDisableTwoFactorAuthForm.tsx +6 -20
- package/src/components/account/hooks/useOtpVerification.tsx +4 -16
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +7 -21
- package/src/components/account/sections/ChangeEmailModal.tsx +21 -35
- package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
- package/src/components/account/sections/ChangePhoneModal.tsx +22 -50
- package/src/components/account/sections/MyProfileSection.tsx +23 -37
- package/src/components/account/sections/PreferencesSection.tsx +25 -52
- package/src/components/account/sections/SecuritySection.tsx +10 -19
- package/src/components/account/sections/TokenSection.tsx +10 -22
- package/src/components/layouts/AppMobileNavBar.tsx +154 -1
- package/src/components/layouts/NavBar.tsx +3 -5
- package/src/components/layouts/NotificationsPopover.tsx +3 -5
- package/src/components/layouts/ProfilePopover.tsx +4 -6
- package/src/components/layouts/UsersSelectorPopover.tsx +7 -9
- package/src/components/modals/BuyCreditsModal.tsx +16 -18
- package/src/components/modals/CreditsDisabledModal.tsx +6 -6
- package/src/components/modals/PaidPlanRequiredModal.tsx +3 -5
- package/src/components/modals/cards/AddCardModal.tsx +27 -29
- package/src/components/modals/cards/CannotDeleteCardModal.tsx +8 -9
- package/src/components/modals/cards/CardFormFields.tsx +22 -25
- package/src/components/modals/cards/DeleteCardModal.tsx +8 -10
- package/src/components/navigation/CancelledSubscriptionBanner.tsx +2 -4
- package/src/components/navigation/OverdueInvoiceBanner.tsx +2 -4
- package/src/components/navigation/PendingCancellationBanner.tsx +2 -4
- package/src/components/navigation/ProjectSelectorPopover.tsx +6 -8
- package/src/components/navigation/UpcomingInvoiceBanner.tsx +2 -4
- package/src/components/navigation/subcomponents/BottomLinks.tsx +3 -5
- package/src/components/navigation/subcomponents/CreditsCard.tsx +1 -3
- package/src/components/navigation/subcomponents/PlanCard.tsx +1 -3
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +3 -5
- package/src/components/pages/NotFoundPage.tsx +3 -5
- package/src/components/pages/notifications/Notifications.tsx +10 -13
- package/src/components/ui/buttons/CopyButton.tsx +5 -10
- package/src/components/ui/data-display/CardItem.tsx +5 -7
- package/src/components/ui/data-display/PaymentInfoCard.tsx +8 -10
- package/src/components/ui/feedback/CircularProgress.tsx +0 -4
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +1 -3
- package/src/components/ui/form/ComboboxField.tsx +6 -11
- package/src/components/ui/form/DatePicker.tsx +2 -5
- package/src/components/ui/form/DateRangePicker.tsx +2 -5
- package/src/components/ui/form/PhoneInput.tsx +3 -5
- package/src/components/ui/form/SelectField.tsx +3 -6
- package/src/components/widgets/ImageUpload/ImageCropModal.tsx +11 -19
- package/src/components/widgets/ImageUpload/ImageTooSmallModal.tsx +5 -6
- package/src/index.ts +2 -12
- package/src/modules/cards/hooks/handle-delete-card.hook.ts +3 -8
- package/src/modules/images/utils/validate-image.ts +8 -23
- package/src/modules/plans/types/plan.type.ts +0 -3
- package/src/modules/plans/utils/map-api-plan-to-ui.ts +46 -103
- package/src/modules/subscriptions/utils/periodicity.ts +12 -29
- package/src/providers/auth.provider.tsx +1 -13
- package/src/server.ts +0 -2
- package/src/utils/format/currency.ts +7 -62
- package/src/utils/intl/locales.ts +2 -3
- package/dist/i18n/config.mjs +0 -13
- package/dist/i18n/config.mjs.map +0 -1
- package/dist/i18n/country-language.mjs +0 -74
- package/dist/i18n/country-language.mjs.map +0 -1
- package/dist/i18n/messages/en-us.mjs +0 -492
- package/dist/i18n/messages/en-us.mjs.map +0 -1
- package/dist/i18n/messages/es-es.mjs +0 -492
- package/dist/i18n/messages/es-es.mjs.map +0 -1
- package/dist/i18n/messages/index.mjs +0 -16
- package/dist/i18n/messages/index.mjs.map +0 -1
- package/dist/i18n/messages/pt-br.mjs +0 -505
- package/dist/i18n/messages/pt-br.mjs.map +0 -1
- package/dist/i18n/normalize.mjs +0 -12
- package/dist/i18n/normalize.mjs.map +0 -1
- package/dist/i18n/resolve-locale.mjs +0 -42
- package/dist/i18n/resolve-locale.mjs.map +0 -1
- package/dist/i18n.mjs +0 -14
- package/dist/i18n.mjs.map +0 -1
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs +0 -20
- package/dist/modules/accounts/hooks/use-currency-formatter.hook.mjs.map +0 -1
- package/dist/utils/intl/cookie-domain.mjs +0 -17
- package/dist/utils/intl/cookie-domain.mjs.map +0 -1
- package/dist/utils/intl/locale-cookie.mjs +0 -13
- package/dist/utils/intl/locale-cookie.mjs.map +0 -1
- package/src/i18n/config.ts +0 -17
- package/src/i18n/country-language.ts +0 -60
- package/src/i18n/messages/en-us.ts +0 -512
- package/src/i18n/messages/es-es.ts +0 -513
- package/src/i18n/messages/index.ts +0 -24
- package/src/i18n/messages/pt-br.ts +0 -536
- package/src/i18n/normalize.ts +0 -15
- package/src/i18n/resolve-locale.ts +0 -77
- package/src/i18n.ts +0 -10
- package/src/modules/accounts/hooks/use-currency-formatter.hook.tsx +0 -32
- package/src/utils/intl/cookie-domain.ts +0 -29
- package/src/utils/intl/locale-cookie.ts +0 -18
|
@@ -4,13 +4,20 @@ import { ReactNode } from "react";
|
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import { IconMenu2, IconX } from "@tabler/icons-react";
|
|
6
6
|
import { ProfilePopover } from "./ProfilePopover";
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
|
|
7
8
|
import { useMobileNavbarSheet } from "../../store/useMobileNavbarSheet";
|
|
8
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
useWhitelabel,
|
|
11
|
+
useIsDefaultWhitelabel,
|
|
12
|
+
} from "../../providers/whitelabel.provider";
|
|
13
|
+
import { cn } from "../../infra/utils/clsx";
|
|
9
14
|
import type { ProfileMenuItem } from "./ProfilePopover";
|
|
10
15
|
|
|
11
16
|
export interface AppMobileNavBarProps {
|
|
12
17
|
/** Which app is currently active — controls which icon gets the indicator */
|
|
13
18
|
activeApp?: "gapps" | "gpages";
|
|
19
|
+
/** Called when the GreatApps logo is clicked */
|
|
20
|
+
onLogoClick?: () => void;
|
|
14
21
|
/** Called when the app icon (e.g. GreatPages) is clicked */
|
|
15
22
|
onAppIconClick?: () => void;
|
|
16
23
|
/** Extra slot rendered after the app icon (e.g. project selector) */
|
|
@@ -21,19 +28,165 @@ export interface AppMobileNavBarProps {
|
|
|
21
28
|
|
|
22
29
|
export function AppMobileNavBar({
|
|
23
30
|
activeApp,
|
|
31
|
+
onLogoClick,
|
|
24
32
|
onAppIconClick,
|
|
25
33
|
extraLeftSlot,
|
|
26
34
|
menuItems = [],
|
|
27
35
|
showMenuToggle = true,
|
|
28
36
|
}: AppMobileNavBarProps) {
|
|
29
37
|
const { isOpen, toggle } = useMobileNavbarSheet();
|
|
38
|
+
const { whitelabel } = useWhitelabel();
|
|
30
39
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
40
|
+
const primaryColor = whitelabel?.general?.primary_color;
|
|
41
|
+
const wlName = whitelabel?.name || "Great";
|
|
31
42
|
|
|
43
|
+
const isGappsActive = activeApp === "gapps";
|
|
32
44
|
const isGpagesActive = activeApp === "gpages";
|
|
33
45
|
|
|
46
|
+
const wlIcon = whitelabel?.secondary_logo ? (
|
|
47
|
+
<Image
|
|
48
|
+
className="size-7 object-contain"
|
|
49
|
+
src={`${process.env.NEXT_PUBLIC_STORAGE_URL}/${whitelabel.secondary_logo}`}
|
|
50
|
+
alt={`${wlName} Logo`}
|
|
51
|
+
width={28}
|
|
52
|
+
height={28}
|
|
53
|
+
/>
|
|
54
|
+
) : (
|
|
55
|
+
<div
|
|
56
|
+
className={cn(
|
|
57
|
+
"size-10 rounded-lg flex items-center justify-center transition-opacity duration-300",
|
|
58
|
+
!isGappsActive && "opacity-20",
|
|
59
|
+
)}
|
|
60
|
+
style={{ backgroundColor: primaryColor }}
|
|
61
|
+
>
|
|
62
|
+
<svg
|
|
63
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
64
|
+
width="24"
|
|
65
|
+
height="24"
|
|
66
|
+
viewBox="0 0 24 24"
|
|
67
|
+
fill="none"
|
|
68
|
+
stroke="white"
|
|
69
|
+
strokeWidth="2"
|
|
70
|
+
strokeLinecap="round"
|
|
71
|
+
strokeLinejoin="round"
|
|
72
|
+
>
|
|
73
|
+
<path d="M4 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
74
|
+
<path d="M14 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
75
|
+
<path d="M4 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
76
|
+
<path d="M14 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4" />
|
|
77
|
+
</svg>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
|
|
34
81
|
return (
|
|
35
82
|
<div className="fixed top-0 left-0 right-0 flex md:hidden items-center justify-between p-4 bg-white z-50 border-b border-gray-200">
|
|
36
83
|
<div className="flex items-center gap-1.5">
|
|
84
|
+
{/* GreatApps logo */}
|
|
85
|
+
<div className="relative">
|
|
86
|
+
<Tooltip>
|
|
87
|
+
<TooltipTrigger asChild>
|
|
88
|
+
<div
|
|
89
|
+
className={cn(
|
|
90
|
+
"flex items-center justify-center",
|
|
91
|
+
onLogoClick ? "cursor-pointer" : "",
|
|
92
|
+
)}
|
|
93
|
+
onClick={onLogoClick}
|
|
94
|
+
>
|
|
95
|
+
{isDefaultWl ? (
|
|
96
|
+
<div className="size-10 flex items-center justify-center rounded-lg">
|
|
97
|
+
<Image
|
|
98
|
+
src="/icons/great-icon.svg"
|
|
99
|
+
alt="Great Icon"
|
|
100
|
+
width={28}
|
|
101
|
+
height={28}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
) : (
|
|
105
|
+
wlIcon
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
</TooltipTrigger>
|
|
109
|
+
<TooltipContent side="bottom">{wlName}</TooltipContent>
|
|
110
|
+
</Tooltip>
|
|
111
|
+
<div
|
|
112
|
+
className={cn(
|
|
113
|
+
"absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] rounded-t-xl transition-opacity duration-300",
|
|
114
|
+
isDefaultWl ? "bg-gray-950" : "",
|
|
115
|
+
isGappsActive ? "opacity-100" : "opacity-0",
|
|
116
|
+
)}
|
|
117
|
+
style={!isDefaultWl ? { backgroundColor: primaryColor } : undefined}
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
{/* GreatPages icon */}
|
|
122
|
+
<div className="relative">
|
|
123
|
+
<Tooltip>
|
|
124
|
+
<TooltipTrigger asChild>
|
|
125
|
+
<div
|
|
126
|
+
className={cn(
|
|
127
|
+
"size-10 rounded-lg flex items-center justify-center border-2 ring-2 transition-colors duration-300",
|
|
128
|
+
isGpagesActive
|
|
129
|
+
? isDefaultWl
|
|
130
|
+
? "bg-cyan-100 border-white ring-cyan-300"
|
|
131
|
+
: "border-white ring-transparent"
|
|
132
|
+
: isDefaultWl
|
|
133
|
+
? "hover:bg-gray-100 border-transparent ring-transparent"
|
|
134
|
+
: "border-transparent ring-transparent",
|
|
135
|
+
onAppIconClick ? "cursor-pointer" : "",
|
|
136
|
+
)}
|
|
137
|
+
style={
|
|
138
|
+
!isDefaultWl
|
|
139
|
+
? {
|
|
140
|
+
backgroundColor: primaryColor,
|
|
141
|
+
boxShadow: isGpagesActive
|
|
142
|
+
? `0 0 0 2px ${primaryColor}40`
|
|
143
|
+
: undefined,
|
|
144
|
+
opacity: !isGpagesActive ? 0.2 : undefined,
|
|
145
|
+
}
|
|
146
|
+
: undefined
|
|
147
|
+
}
|
|
148
|
+
onClick={onAppIconClick}
|
|
149
|
+
>
|
|
150
|
+
{isDefaultWl ? (
|
|
151
|
+
<Image
|
|
152
|
+
src="/icons/icon-navbar.svg"
|
|
153
|
+
alt="GreatPages"
|
|
154
|
+
width={24}
|
|
155
|
+
height={24}
|
|
156
|
+
/>
|
|
157
|
+
) : (
|
|
158
|
+
<svg
|
|
159
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
+
width="24"
|
|
161
|
+
height="24"
|
|
162
|
+
viewBox="0 0 24 24"
|
|
163
|
+
fill="none"
|
|
164
|
+
stroke="white"
|
|
165
|
+
strokeWidth="2"
|
|
166
|
+
strokeLinecap="round"
|
|
167
|
+
strokeLinejoin="round"
|
|
168
|
+
>
|
|
169
|
+
<path d="M4 8h16" />
|
|
170
|
+
<path d="M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12" />
|
|
171
|
+
<path d="M8 4v4" />
|
|
172
|
+
</svg>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
</TooltipTrigger>
|
|
176
|
+
<TooltipContent side="bottom">
|
|
177
|
+
{isDefaultWl ? "GreatPages" : "Páginas"}
|
|
178
|
+
</TooltipContent>
|
|
179
|
+
</Tooltip>
|
|
180
|
+
<div
|
|
181
|
+
className={cn(
|
|
182
|
+
"absolute -bottom-[17px] left-1/2 -translate-x-1/2 w-5 h-[3px] rounded-t-xl transition-opacity duration-300",
|
|
183
|
+
isDefaultWl ? "bg-cyan-300" : "",
|
|
184
|
+
isGpagesActive ? "opacity-100" : "opacity-0",
|
|
185
|
+
)}
|
|
186
|
+
style={!isDefaultWl ? { backgroundColor: primaryColor } : undefined}
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
37
190
|
{extraLeftSlot}
|
|
38
191
|
</div>
|
|
39
192
|
<div className="flex items-center gap-1.5">
|
|
@@ -3,7 +3,6 @@
|
|
|
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";
|
|
7
6
|
import { IconChevronRight } from "@tabler/icons-react";
|
|
8
7
|
import { Separator } from "../ui/data-display/Separator";
|
|
9
8
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/overlay/Tooltip";
|
|
@@ -36,7 +35,6 @@ function NavBar({
|
|
|
36
35
|
children,
|
|
37
36
|
className,
|
|
38
37
|
}: NavBarProps) {
|
|
39
|
-
const translate = useTranslations();
|
|
40
38
|
const { isExpanded: isDesktopExpanded, toggle: toggleDesktop } =
|
|
41
39
|
useDesktopSidebarStore();
|
|
42
40
|
useDesktopSidebarHydration();
|
|
@@ -130,7 +128,7 @@ function NavBar({
|
|
|
130
128
|
<IconChevronRight size={16} className="text-gray-500" />
|
|
131
129
|
</button>
|
|
132
130
|
</TooltipTrigger>
|
|
133
|
-
<TooltipContent side="right">
|
|
131
|
+
<TooltipContent side="right">Expandir menu</TooltipContent>
|
|
134
132
|
</Tooltip>
|
|
135
133
|
)}
|
|
136
134
|
{/* Desktop expand button */}
|
|
@@ -144,7 +142,7 @@ function NavBar({
|
|
|
144
142
|
<IconChevronRight size={16} className="text-gray-500" />
|
|
145
143
|
</button>
|
|
146
144
|
</TooltipTrigger>
|
|
147
|
-
<TooltipContent side="right">
|
|
145
|
+
<TooltipContent side="right">Expandir menu</TooltipContent>
|
|
148
146
|
</Tooltip>
|
|
149
147
|
)}
|
|
150
148
|
</div>
|
|
@@ -205,7 +203,7 @@ function NavBar({
|
|
|
205
203
|
</Link>
|
|
206
204
|
</TooltipTrigger>
|
|
207
205
|
<TooltipContent side="right">
|
|
208
|
-
{isDefaultWl ?
|
|
206
|
+
{isDefaultWl ? "GreatPages" : "Páginas"}
|
|
209
207
|
</TooltipContent>
|
|
210
208
|
</Tooltip>
|
|
211
209
|
<div
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
4
|
import { IconBell } from '@tabler/icons-react';
|
|
6
5
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
7
6
|
import { Popover } from "../ui/overlay/Popover";
|
|
@@ -28,7 +27,6 @@ function NotificationsPopover({
|
|
|
28
27
|
contentClassName,
|
|
29
28
|
badgeClassName,
|
|
30
29
|
}: NotificationsPopoverProps) {
|
|
31
|
-
const translate = useTranslations();
|
|
32
30
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
33
31
|
const resolvedBadgeClassName = badgeClassName ?? (isDefaultWl ? "bg-cyan-300" : "bg-zinc-300");
|
|
34
32
|
const [open, setOpen] = useState(false);
|
|
@@ -73,7 +71,7 @@ function NotificationsPopover({
|
|
|
73
71
|
sideOffset={8}
|
|
74
72
|
>
|
|
75
73
|
<span className="paragraph-small-semibold text-gray-950 px-4">
|
|
76
|
-
|
|
74
|
+
Últimas notificações
|
|
77
75
|
</span>
|
|
78
76
|
|
|
79
77
|
{messages.length > 0 ? (
|
|
@@ -97,7 +95,7 @@ function NotificationsPopover({
|
|
|
97
95
|
<IconBell size={20} color="var(--color-gray-950)" />
|
|
98
96
|
</div>
|
|
99
97
|
<span className="paragraph-small-medium text-gray-950">
|
|
100
|
-
|
|
98
|
+
Sem notificações por enquanto
|
|
101
99
|
</span>
|
|
102
100
|
</div>
|
|
103
101
|
)}
|
|
@@ -108,7 +106,7 @@ function NotificationsPopover({
|
|
|
108
106
|
className="h-8! mt-2 mb-4 mx-4 paragraph-small-semibold"
|
|
109
107
|
onClick={onViewAll}
|
|
110
108
|
>
|
|
111
|
-
|
|
109
|
+
Todas as notificações
|
|
112
110
|
</Button>
|
|
113
111
|
)}
|
|
114
112
|
</PopoverPrimitive.Content>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
4
|
import { useRouter } from "next/navigation";
|
|
6
5
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
7
6
|
import { Popover } from "../ui/overlay/Popover";
|
|
@@ -37,7 +36,6 @@ function ProfilePopover({
|
|
|
37
36
|
contentClassName = "absolute bottom-2 left-[26px]",
|
|
38
37
|
menuItems = [],
|
|
39
38
|
}: ProfilePopoverProps) {
|
|
40
|
-
const translate = useTranslations();
|
|
41
39
|
const { user, logout } = useAuth();
|
|
42
40
|
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
43
41
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
@@ -70,7 +68,7 @@ function ProfilePopover({
|
|
|
70
68
|
<>
|
|
71
69
|
<LoadingOverlay
|
|
72
70
|
isLoading={isLoggingOut}
|
|
73
|
-
message=
|
|
71
|
+
message="Saindo da sua conta..."
|
|
74
72
|
/>
|
|
75
73
|
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
|
|
76
74
|
<PopoverPrimitive.Trigger className="cursor-pointer">
|
|
@@ -126,7 +124,7 @@ function ProfilePopover({
|
|
|
126
124
|
}
|
|
127
125
|
}}
|
|
128
126
|
>
|
|
129
|
-
|
|
127
|
+
Editar
|
|
130
128
|
</Button>
|
|
131
129
|
</div>
|
|
132
130
|
|
|
@@ -148,7 +146,7 @@ function ProfilePopover({
|
|
|
148
146
|
>
|
|
149
147
|
<div className="flex items-center justify-between gap-2">
|
|
150
148
|
<span className="paragraph-xsmall-semibold text-white truncate">
|
|
151
|
-
|
|
149
|
+
Créditos usados
|
|
152
150
|
</span>
|
|
153
151
|
<span className="paragraph-xsmall-medium text-white/50">
|
|
154
152
|
{summary.usedCredits.toLocaleString("pt-BR")}/
|
|
@@ -175,7 +173,7 @@ function ProfilePopover({
|
|
|
175
173
|
))}
|
|
176
174
|
</div>
|
|
177
175
|
<Separator />
|
|
178
|
-
<NavBarItem label=
|
|
176
|
+
<NavBarItem label="Sair" onClick={handleLogout} />
|
|
179
177
|
</div>
|
|
180
178
|
</div>
|
|
181
179
|
</PopoverPrimitive.Content>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
4
|
import { IconPlus, IconUser, IconUsers } from '@tabler/icons-react';
|
|
6
5
|
import { UserAvatar } from "../ui/data-display/UserAvatar";
|
|
7
6
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/overlay/Popover";
|
|
@@ -47,7 +46,6 @@ export function UsersSelectorPopover({
|
|
|
47
46
|
align,
|
|
48
47
|
contentClassName,
|
|
49
48
|
}: UsersSelectorPopoverProps) {
|
|
50
|
-
const translate = useTranslations();
|
|
51
49
|
const { accountsUrl } = useWhitelabelUrls();
|
|
52
50
|
const [open, setOpen] = useState(false);
|
|
53
51
|
const [hoveredId, setHoveredId] = useState<number | null>(null);
|
|
@@ -110,7 +108,7 @@ export function UsersSelectorPopover({
|
|
|
110
108
|
>
|
|
111
109
|
<div className="flex flex-col p-3 gap-2">
|
|
112
110
|
<div className="flex items-center justify-between">
|
|
113
|
-
<span className="paragraph-small-semibold">
|
|
111
|
+
<span className="paragraph-small-semibold">Usuários</span>
|
|
114
112
|
<div className="flex items-center gap-1.5">
|
|
115
113
|
<Button
|
|
116
114
|
variant="secondary"
|
|
@@ -120,14 +118,14 @@ export function UsersSelectorPopover({
|
|
|
120
118
|
}}
|
|
121
119
|
>
|
|
122
120
|
<IconPlus size={16} />
|
|
123
|
-
|
|
121
|
+
Adicionar
|
|
124
122
|
</Button>
|
|
125
123
|
</div>
|
|
126
124
|
</div>
|
|
127
125
|
|
|
128
126
|
<Command shouldFilter={false} className="gap-2" value="">
|
|
129
127
|
<CommandInput
|
|
130
|
-
placeholder=
|
|
128
|
+
placeholder="Busque aqui"
|
|
131
129
|
value={searchInput}
|
|
132
130
|
onValueChange={setSearchInput}
|
|
133
131
|
/>
|
|
@@ -145,12 +143,12 @@ export function UsersSelectorPopover({
|
|
|
145
143
|
<div className="flex flex-col items-center justify-center gap-2 h-full text-gray-400 py-4">
|
|
146
144
|
<IconUsers size={28} className="text-gray-300" />
|
|
147
145
|
<span className="paragraph-small-medium text-center text-gray-500">
|
|
148
|
-
|
|
146
|
+
Nenhum usuário encontrado.
|
|
149
147
|
</span>
|
|
150
148
|
</div>
|
|
151
149
|
) : (
|
|
152
150
|
<>
|
|
153
|
-
<CommandEmpty>
|
|
151
|
+
<CommandEmpty>Nenhum resultado encontrado.</CommandEmpty>
|
|
154
152
|
{allUsers.map((user) => {
|
|
155
153
|
const inProject = user.in_project ?? false;
|
|
156
154
|
const removable =
|
|
@@ -202,7 +200,7 @@ export function UsersSelectorPopover({
|
|
|
202
200
|
</div>
|
|
203
201
|
</TooltipTrigger>
|
|
204
202
|
<TooltipContent className="z-[1002]">
|
|
205
|
-
{inProject ?
|
|
203
|
+
{inProject ? "Remover do projeto" : "Adicionar ao projeto"}
|
|
206
204
|
</TooltipContent>
|
|
207
205
|
</Tooltip>
|
|
208
206
|
</div>
|
|
@@ -227,7 +225,7 @@ export function UsersSelectorPopover({
|
|
|
227
225
|
window.location.href = `${accountsUrl}/my-teams`;
|
|
228
226
|
}}
|
|
229
227
|
>
|
|
230
|
-
|
|
228
|
+
Gerenciar equipe
|
|
231
229
|
</Button>
|
|
232
230
|
</div>
|
|
233
231
|
</PopoverContent>
|
|
@@ -26,7 +26,6 @@ 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';
|
|
30
29
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
31
30
|
import { useForm } from 'react-hook-form';
|
|
32
31
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -43,7 +42,6 @@ const buyCreditSchema = z.object({
|
|
|
43
42
|
type BuyCreditFormData = z.infer<typeof buyCreditSchema>;
|
|
44
43
|
|
|
45
44
|
export default function BuyCreditsModal() {
|
|
46
|
-
const translate = useTranslations();
|
|
47
45
|
const { open, closeModal } = useBuyCreditsModal();
|
|
48
46
|
const { openModal } = useModalManager();
|
|
49
47
|
const isDefaultWl = useIsDefaultWhitelabel();
|
|
@@ -188,12 +186,12 @@ export default function BuyCreditsModal() {
|
|
|
188
186
|
label: (
|
|
189
187
|
<div className="flex items-center justify-between gap-2 w-full">
|
|
190
188
|
<span className="paragraph-small-medium text-zinc-950 flex-1">
|
|
191
|
-
{
|
|
189
|
+
{opt.credits.toLocaleString('pt-BR')} créditos de IA
|
|
192
190
|
</span>
|
|
193
191
|
<span className="paragraph-small-medium text-zinc-500 opacity-70">{opt.priceLabel}</span>
|
|
194
192
|
</div>
|
|
195
193
|
),
|
|
196
|
-
displayValue:
|
|
194
|
+
displayValue: `${opt.credits.toLocaleString('pt-BR')} créditos de IA`,
|
|
197
195
|
}));
|
|
198
196
|
}, []);
|
|
199
197
|
|
|
@@ -219,7 +217,7 @@ export default function BuyCreditsModal() {
|
|
|
219
217
|
toast.custom((t) => (
|
|
220
218
|
<Toast
|
|
221
219
|
variant="success"
|
|
222
|
-
message={
|
|
220
|
+
message={`Créditos de IA alterados para ${data.creditOption.toLocaleString('pt-BR')}`}
|
|
223
221
|
toastId={t}
|
|
224
222
|
/>
|
|
225
223
|
));
|
|
@@ -236,7 +234,7 @@ export default function BuyCreditsModal() {
|
|
|
236
234
|
if (totalPrice !== null) {
|
|
237
235
|
return (
|
|
238
236
|
<span className="paragraph-xlarge-semibold text-zinc-950">
|
|
239
|
-
{totalPrice === 0 ?
|
|
237
|
+
{totalPrice === 0 ? 'Padrão' : formatPrice(totalPrice)}
|
|
240
238
|
</span>
|
|
241
239
|
);
|
|
242
240
|
}
|
|
@@ -253,10 +251,10 @@ export default function BuyCreditsModal() {
|
|
|
253
251
|
</div>
|
|
254
252
|
<div className="flex flex-col gap-2">
|
|
255
253
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
256
|
-
|
|
254
|
+
Créditos de IA
|
|
257
255
|
</DialogTitle>
|
|
258
256
|
<span className="paragraph-small-regular text-zinc-600">
|
|
259
|
-
|
|
257
|
+
Para adquirir créditos de IA, acesse sua área de assinatura.
|
|
260
258
|
</span>
|
|
261
259
|
</div>
|
|
262
260
|
</DialogHeader>
|
|
@@ -268,7 +266,7 @@ export default function BuyCreditsModal() {
|
|
|
268
266
|
redirectToExternal('contracting');
|
|
269
267
|
}}
|
|
270
268
|
>
|
|
271
|
-
|
|
269
|
+
Acessar área de assinatura
|
|
272
270
|
</Button>
|
|
273
271
|
</div>
|
|
274
272
|
</DialogContent>
|
|
@@ -284,7 +282,7 @@ export default function BuyCreditsModal() {
|
|
|
284
282
|
>
|
|
285
283
|
<DialogHeader className="px-4 py-3 border-b border-zinc-200 shrink-0 relative">
|
|
286
284
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950 text-center">
|
|
287
|
-
|
|
285
|
+
Comprar créditos de IA
|
|
288
286
|
</DialogTitle>
|
|
289
287
|
<button
|
|
290
288
|
type="button"
|
|
@@ -321,8 +319,8 @@ export default function BuyCreditsModal() {
|
|
|
321
319
|
<IconInfoCircle className="size-4 text-zinc-950 shrink-0" />
|
|
322
320
|
<span className="paragraph-small-regular text-zinc-950">
|
|
323
321
|
{isIncreasingCredits
|
|
324
|
-
?
|
|
325
|
-
:
|
|
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.'}
|
|
326
324
|
</span>
|
|
327
325
|
</div>
|
|
328
326
|
)}
|
|
@@ -333,7 +331,7 @@ export default function BuyCreditsModal() {
|
|
|
333
331
|
<div className="hidden lg:flex flex-col gap-2">
|
|
334
332
|
{immediateChargeTotal !== null && immediateChargeTotal > 0 && (
|
|
335
333
|
<div className="flex items-center justify-between">
|
|
336
|
-
<span className="paragraph-xsmall-medium text-zinc-500">
|
|
334
|
+
<span className="paragraph-xsmall-medium text-zinc-500">Cobrança imediata</span>
|
|
337
335
|
{isCalculatePending ? (
|
|
338
336
|
<Skeleton className="h-5 w-20" />
|
|
339
337
|
) : (
|
|
@@ -344,7 +342,7 @@ export default function BuyCreditsModal() {
|
|
|
344
342
|
</div>
|
|
345
343
|
)}
|
|
346
344
|
<div className="flex items-center justify-between">
|
|
347
|
-
<span className="paragraph-small-medium text-zinc-500">
|
|
345
|
+
<span className="paragraph-small-medium text-zinc-500">Valor total do plano</span>
|
|
348
346
|
{renderPriceDisplay()}
|
|
349
347
|
</div>
|
|
350
348
|
</div>
|
|
@@ -355,7 +353,7 @@ export default function BuyCreditsModal() {
|
|
|
355
353
|
className="w-full hidden lg:inline-flex"
|
|
356
354
|
>
|
|
357
355
|
{isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
|
|
358
|
-
|
|
356
|
+
Confirmar e pagar
|
|
359
357
|
</Button>
|
|
360
358
|
</div>
|
|
361
359
|
|
|
@@ -363,7 +361,7 @@ export default function BuyCreditsModal() {
|
|
|
363
361
|
<div className="flex flex-col gap-2">
|
|
364
362
|
{immediateChargeTotal !== null && immediateChargeTotal > 0 && (
|
|
365
363
|
<div className="flex items-center justify-between">
|
|
366
|
-
<span className="paragraph-xsmall-medium text-zinc-500">
|
|
364
|
+
<span className="paragraph-xsmall-medium text-zinc-500">Cobrança imediata</span>
|
|
367
365
|
{isCalculatePending ? (
|
|
368
366
|
<Skeleton className="h-5 w-20" />
|
|
369
367
|
) : (
|
|
@@ -374,13 +372,13 @@ export default function BuyCreditsModal() {
|
|
|
374
372
|
</div>
|
|
375
373
|
)}
|
|
376
374
|
<div className="flex items-center justify-between">
|
|
377
|
-
<span className="paragraph-small-medium text-zinc-500">
|
|
375
|
+
<span className="paragraph-small-medium text-zinc-500">Valor total do plano</span>
|
|
378
376
|
{renderPriceDisplay()}
|
|
379
377
|
</div>
|
|
380
378
|
</div>
|
|
381
379
|
<Button type="submit" disabled={isConfirmDisabled} className="w-full">
|
|
382
380
|
{isSubmitting && <IconLoader2 className="size-4 animate-spin" />}
|
|
383
|
-
|
|
381
|
+
Confirmar e pagar
|
|
384
382
|
</Button>
|
|
385
383
|
</div>
|
|
386
384
|
</form>
|
|
@@ -10,11 +10,9 @@ 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';
|
|
14
13
|
import { useCreditsDisabledModal } from '../../store/useCreditsDisabledModal';
|
|
15
14
|
|
|
16
15
|
export default function CreditsDisabledModal() {
|
|
17
|
-
const translate = useTranslations();
|
|
18
16
|
const { open, closeModal } = useCreditsDisabledModal();
|
|
19
17
|
|
|
20
18
|
return (
|
|
@@ -34,12 +32,14 @@ export default function CreditsDisabledModal() {
|
|
|
34
32
|
</div>
|
|
35
33
|
<div className="flex flex-col gap-2">
|
|
36
34
|
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
37
|
-
|
|
35
|
+
Compra de créditos indisponível
|
|
38
36
|
</DialogTitle>
|
|
39
37
|
<DialogDescription className="paragraph-small-regular text-zinc-600" asChild>
|
|
40
38
|
<div className="flex flex-col gap-3">
|
|
41
|
-
<p>
|
|
42
|
-
<p>
|
|
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>
|
|
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
|
-
|
|
56
|
+
Entendi
|
|
57
57
|
</Button>
|
|
58
58
|
</div>
|
|
59
59
|
</DialogContent>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { IconLock } from '@tabler/icons-react';
|
|
4
|
-
import { useTranslations } from 'next-intl';
|
|
5
4
|
import { Button } from '../ui/buttons/Button';
|
|
6
5
|
import {
|
|
7
6
|
Dialog,
|
|
@@ -15,15 +14,14 @@ import { useModalManager } from '../../store/useModalManager';
|
|
|
15
14
|
import type { ModalData } from '../../store/useModalManager';
|
|
16
15
|
|
|
17
16
|
export default function PaidPlanRequiredModal() {
|
|
18
|
-
const translate = useTranslations();
|
|
19
17
|
const { activeModal, modalData, closeModal } = useModalManager();
|
|
20
18
|
const isOpen = activeModal === 'paidPlanRequiredModal';
|
|
21
19
|
const data = modalData as ModalData & { title?: string; description?: string };
|
|
22
20
|
const { accountsUrl } = useWhitelabelUrls();
|
|
23
21
|
const { redirectToExternal } = useExternalContracting();
|
|
24
22
|
|
|
25
|
-
const title = (data.title as string) ??
|
|
26
|
-
const description = (data.description as string) ??
|
|
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";
|
|
27
25
|
|
|
28
26
|
const handleKnowPlans = () => {
|
|
29
27
|
if (redirectToExternal('plans')) return;
|
|
@@ -51,7 +49,7 @@ export default function PaidPlanRequiredModal() {
|
|
|
51
49
|
className="w-fit h-10!"
|
|
52
50
|
onClick={handleKnowPlans}
|
|
53
51
|
>
|
|
54
|
-
|
|
52
|
+
Conhecer planos
|
|
55
53
|
</Button>
|
|
56
54
|
</div>
|
|
57
55
|
</DialogContent>
|