saafe-redirection-flow 2.0.0

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 (225) hide show
  1. package/.github/workflows/build-and-deploy.yml +41 -0
  2. package/.gitlab-ci.yml +108 -0
  3. package/.releaserc.json +18 -0
  4. package/.storybook/main.ts +28 -0
  5. package/.storybook/preview.ts +16 -0
  6. package/.storybook/vitest.setup.ts +9 -0
  7. package/.vite/deps/@radix-ui_react-avatar.js +230 -0
  8. package/.vite/deps/@radix-ui_react-avatar.js.map +7 -0
  9. package/.vite/deps/@radix-ui_react-slot.js +12 -0
  10. package/.vite/deps/@radix-ui_react-slot.js.map +7 -0
  11. package/.vite/deps/_metadata.json +79 -0
  12. package/.vite/deps/chunk-5VGQBUCU.js +597 -0
  13. package/.vite/deps/chunk-5VGQBUCU.js.map +7 -0
  14. package/.vite/deps/chunk-DC5AMYBS.js +38 -0
  15. package/.vite/deps/chunk-DC5AMYBS.js.map +7 -0
  16. package/.vite/deps/chunk-HUIEPYH7.js +11265 -0
  17. package/.vite/deps/chunk-HUIEPYH7.js.map +7 -0
  18. package/.vite/deps/chunk-TKHB4QMX.js +281 -0
  19. package/.vite/deps/chunk-TKHB4QMX.js.map +7 -0
  20. package/.vite/deps/chunk-YLDSBLSF.js +1139 -0
  21. package/.vite/deps/chunk-YLDSBLSF.js.map +7 -0
  22. package/.vite/deps/class-variance-authority.js +63 -0
  23. package/.vite/deps/class-variance-authority.js.map +7 -0
  24. package/.vite/deps/lucide-react.js +36984 -0
  25. package/.vite/deps/lucide-react.js.map +7 -0
  26. package/.vite/deps/package.json +3 -0
  27. package/.vite/deps/react-dom_client.js +17917 -0
  28. package/.vite/deps/react-dom_client.js.map +7 -0
  29. package/.vite/deps/react-router-dom.js +452 -0
  30. package/.vite/deps/react-router-dom.js.map +7 -0
  31. package/.vite/deps/react-router.js +234 -0
  32. package/.vite/deps/react-router.js.map +7 -0
  33. package/.vite/deps/react.js +5 -0
  34. package/.vite/deps/react.js.map +7 -0
  35. package/.vite/deps/react_jsx-dev-runtime.js +470 -0
  36. package/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
  37. package/CHANGELOG.md +420 -0
  38. package/LICENSE +21 -0
  39. package/README.md +129 -0
  40. package/RELEASE_CHEATSHEET.md +93 -0
  41. package/RELEASE_NOTES.md +120 -0
  42. package/components.json +21 -0
  43. package/docs/DEPLOYMENT_WORKFLOW.md +262 -0
  44. package/docs/RELEASE_GUIDE.md +591 -0
  45. package/docs/architecture.md +432 -0
  46. package/docs/components.md +199 -0
  47. package/docs/index.md +69 -0
  48. package/docs/local-release-workflow.md +234 -0
  49. package/docs/routes.md +118 -0
  50. package/docs/sdk-integration.md +325 -0
  51. package/docs/semantic-release.md +124 -0
  52. package/docs/user-flow.md +206 -0
  53. package/eslint.config.js +28 -0
  54. package/index.html +19 -0
  55. package/install.sh +198 -0
  56. package/package.json +115 -0
  57. package/public/images/bank-logo.png +0 -0
  58. package/public/saafe-icon.svg +9 -0
  59. package/src/App.tsx +171 -0
  60. package/src/__tests__/url-parameters.test.ts +82 -0
  61. package/src/assets/brand/applestore.svg +13 -0
  62. package/src/assets/brand/playstore.svg +23 -0
  63. package/src/assets/brand/saafe-color-white-logo.svg +14 -0
  64. package/src/assets/brand/saafe-icon.svg +9 -0
  65. package/src/assets/brand/saafe-logo.svg +18 -0
  66. package/src/assets/icons/check-icon-dark.svg +27 -0
  67. package/src/assets/icons/check-icon.svg +23 -0
  68. package/src/components/ErrorBoundary.tsx +132 -0
  69. package/src/components/alert/alert.tsx +27 -0
  70. package/src/components/auth/AuthGuard.tsx +76 -0
  71. package/src/components/cards/BankCard.stories.tsx +69 -0
  72. package/src/components/cards/BankCard.tsx +227 -0
  73. package/src/components/cards/OuterCard.tsx +109 -0
  74. package/src/components/cards/WrapperCard.tsx +64 -0
  75. package/src/components/documents/PrivacyContent.tsx +1 -0
  76. package/src/components/dummyFooter.tsx +29 -0
  77. package/src/components/icons/github.tsx +12 -0
  78. package/src/components/language/LanguageSwitcher.tsx +44 -0
  79. package/src/components/layouts/FrostedLayout.stories.tsx +42 -0
  80. package/src/components/layouts/FrostedLayout.tsx +333 -0
  81. package/src/components/layouts/MobileLayout.tsx +403 -0
  82. package/src/components/mobile-background.tsx +136 -0
  83. package/src/components/mobileAppDownload.tsx +30 -0
  84. package/src/components/modal/ModalComp.tsx +27 -0
  85. package/src/components/mode-toggle.tsx +36 -0
  86. package/src/components/page-header.tsx +50 -0
  87. package/src/components/session/SessionTimeoutScreen.tsx +134 -0
  88. package/src/components/session/SessionTimer.tsx +173 -0
  89. package/src/components/step-navigation.tsx +87 -0
  90. package/src/components/title/AppBar.stories.tsx +50 -0
  91. package/src/components/title/AppBar.tsx +150 -0
  92. package/src/components/title/SectionTitle.tsx +31 -0
  93. package/src/components/ui/AnimatedButton.module.css +13 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/animatedButton.tsx +111 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +36 -0
  98. package/src/components/ui/bottom-sheet.tsx +122 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +86 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/checkbox.stories.tsx +49 -0
  103. package/src/components/ui/checkbox.tsx +67 -0
  104. package/src/components/ui/collapsible.tsx +45 -0
  105. package/src/components/ui/dialog.tsx +134 -0
  106. package/src/components/ui/document-link.tsx +26 -0
  107. package/src/components/ui/dot-stepper.tsx +57 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/frosted-panel.stories.tsx +86 -0
  111. package/src/components/ui/frosted-panel.tsx +276 -0
  112. package/src/components/ui/input.tsx +39 -0
  113. package/src/components/ui/label.stories.tsx +67 -0
  114. package/src/components/ui/label.tsx +23 -0
  115. package/src/components/ui/mobile-footer.tsx +54 -0
  116. package/src/components/ui/modal.tsx +90 -0
  117. package/src/components/ui/otp-input.stories.tsx +62 -0
  118. package/src/components/ui/otp-input.tsx +221 -0
  119. package/src/components/ui/platform-specific-behavior.tsx +28 -0
  120. package/src/components/ui/popover.tsx +46 -0
  121. package/src/components/ui/progress.tsx +103 -0
  122. package/src/components/ui/radio-group.tsx +45 -0
  123. package/src/components/ui/scroll-area.tsx +56 -0
  124. package/src/components/ui/sdk-params-docs.tsx +53 -0
  125. package/src/components/ui/select.tsx +159 -0
  126. package/src/components/ui/separator.tsx +28 -0
  127. package/src/components/ui/sheet.tsx +137 -0
  128. package/src/components/ui/sidebar.tsx +724 -0
  129. package/src/components/ui/skeleton.stories.tsx +50 -0
  130. package/src/components/ui/skeleton.tsx +15 -0
  131. package/src/components/ui/sonner.tsx +23 -0
  132. package/src/components/ui/step.stories.tsx +132 -0
  133. package/src/components/ui/step.tsx +234 -0
  134. package/src/components/ui/stepper-progress.tsx +136 -0
  135. package/src/components/ui/stepper.tsx +259 -0
  136. package/src/components/ui/tabs.tsx +55 -0
  137. package/src/components/ui/tooltip.tsx +61 -0
  138. package/src/components/ui/url-decode-loader.tsx +36 -0
  139. package/src/components/ui/version-display.tsx +104 -0
  140. package/src/components/ui/web-footer.tsx +36 -0
  141. package/src/config/environments.ts +99 -0
  142. package/src/config/urls.ts +53 -0
  143. package/src/const/fiTypeCategoryMap.ts +19 -0
  144. package/src/contexts/LanguageContext.tsx +41 -0
  145. package/src/contexts/RTLContext.tsx +42 -0
  146. package/src/contexts/ThemeContext.tsx +93 -0
  147. package/src/hooks/use-account-discovery.ts +205 -0
  148. package/src/hooks/use-auth-query.ts +141 -0
  149. package/src/hooks/use-fip-query.ts +72 -0
  150. package/src/hooks/use-media-query.ts +32 -0
  151. package/src/hooks/use-mobile.ts +24 -0
  152. package/src/hooks/use-page-title.tsx +48 -0
  153. package/src/hooks/use-platform.ts +52 -0
  154. package/src/hooks/use-trusted-count.ts +21 -0
  155. package/src/hooks/use-url-decode.ts +90 -0
  156. package/src/hooks/useStep.ts +170 -0
  157. package/src/index.css +154 -0
  158. package/src/interfaces/app.interfaces.ts +39 -0
  159. package/src/interfaces/services.interfaces.ts +65 -0
  160. package/src/lib/i18n.ts +68 -0
  161. package/src/lib/utils.ts +6 -0
  162. package/src/locales/en/common.json +167 -0
  163. package/src/locales/hi/common.json +137 -0
  164. package/src/locales/kn/common.json +137 -0
  165. package/src/locales/ml/common.json +137 -0
  166. package/src/locales/ta/common.json +137 -0
  167. package/src/locales/te/common.json +137 -0
  168. package/src/locales/ur/common.json +138 -0
  169. package/src/main.tsx +46 -0
  170. package/src/pages/Login.tsx +363 -0
  171. package/src/pages/accounts/AccountsToProceed.tsx +396 -0
  172. package/src/pages/accounts/Discover.tsx +76 -0
  173. package/src/pages/accounts/DiscoverAccount.tsx +751 -0
  174. package/src/pages/accounts/LinkSelectedAccounts.tsx +638 -0
  175. package/src/pages/accounts/OldUser.tsx +329 -0
  176. package/src/pages/accounts/link-accounts.tsx +913 -0
  177. package/src/pages/consent/ReviewConsent.tsx +836 -0
  178. package/src/pages/consent/rejected.tsx +253 -0
  179. package/src/pages/consent/success.tsx +220 -0
  180. package/src/providers/query-provider.tsx +24 -0
  181. package/src/providers/toast-provider.tsx +26 -0
  182. package/src/services/api/account.service.ts +296 -0
  183. package/src/services/api/auth.service.ts +206 -0
  184. package/src/services/api/axios.ts +138 -0
  185. package/src/services/api/consent.service.ts +142 -0
  186. package/src/services/api/decode.service.ts +53 -0
  187. package/src/services/api/feedback.service.ts +34 -0
  188. package/src/services/api/fip.service.ts +187 -0
  189. package/src/services/api/index.ts +9 -0
  190. package/src/services/api/public.service.ts +18 -0
  191. package/src/services/api.ts +2 -0
  192. package/src/services/postMessage.service.ts +179 -0
  193. package/src/store/NavigationBlockContext.tsx +34 -0
  194. package/src/store/auth.store.ts +79 -0
  195. package/src/store/fip.store.ts +396 -0
  196. package/src/store/mandatoryConsent.store.ts +24 -0
  197. package/src/store/redirect.store.ts +73 -0
  198. package/src/store/step.store.ts +124 -0
  199. package/src/stories/Button.stories.ts +53 -0
  200. package/src/stories/Button.tsx +37 -0
  201. package/src/stories/Configure.mdx +364 -0
  202. package/src/stories/Header.stories.ts +33 -0
  203. package/src/stories/Header.tsx +56 -0
  204. package/src/stories/Page.stories.ts +32 -0
  205. package/src/stories/Page.tsx +73 -0
  206. package/src/stories/button.css +30 -0
  207. package/src/stories/header.css +32 -0
  208. package/src/stories/page.css +68 -0
  209. package/src/styles/rtl-utils.css +90 -0
  210. package/src/styles/rtl.css +105 -0
  211. package/src/utils/api-error.ts +26 -0
  212. package/src/utils/cn.ts +10 -0
  213. package/src/utils/error-callback.ts +116 -0
  214. package/src/utils/formatAccountNumber.ts +9 -0
  215. package/src/utils/handleIdentifiers.ts +90 -0
  216. package/src/utils/posthog.ts +67 -0
  217. package/src/utils/toast-helpers.ts +61 -0
  218. package/src/vite-env.d.ts +1 -0
  219. package/stage-aa-2506251021.zip +0 -0
  220. package/tsconfig.app.json +33 -0
  221. package/tsconfig.json +13 -0
  222. package/tsconfig.node.json +24 -0
  223. package/vite.config.ts +45 -0
  224. package/vitest.shims.d.ts +1 -0
  225. package/vitest.workspace.ts +46 -0
@@ -0,0 +1,329 @@
1
+ import BankCard from '@/components/cards/BankCard'
2
+ import OuterCard from '@/components/cards/OuterCard'
3
+ import SectionTitle from '@/components/title/SectionTitle'
4
+ import { AnimatedButton } from '@/components/ui/animatedButton'
5
+ import { Button } from '@/components/ui/button'
6
+ import { Checkbox } from '@/components/ui/checkbox'
7
+ import { ScrollArea } from '@/components/ui/scroll-area'
8
+ import { accountService } from '@/services/api'
9
+ import { useQuery } from '@tanstack/react-query'
10
+ import { AlertCircle, PlusIcon } from 'lucide-react'
11
+ import React from 'react'
12
+ import { useRedirectStore } from '@/store/redirect.store'
13
+ import { FrostedLayout } from '@/components/layouts/FrostedLayout'
14
+ import { useFipStore } from '@/store/fip.store'
15
+ import { formatAccountNumber } from '@/utils/formatAccountNumber'
16
+ import { MobileFooter } from '@/components/ui/mobile-footer'
17
+ import WebFooter from '@/components/ui/web-footer'
18
+ import { useNavigate } from 'react-router-dom'
19
+ import { t } from 'i18next'
20
+ import { useAccountDiscovery } from '@/hooks/use-account-discovery'
21
+ import { Skeleton } from '@/components/ui/skeleton'
22
+ import { Alert, AlertDescription } from '@/components/ui/alert'
23
+ import { useSetPageTitle } from '@/hooks/use-page-title'
24
+ import { useNavigationBlock } from '@/store/NavigationBlockContext'
25
+ import DummyFooter from '@/components/dummyFooter'
26
+ import { useFipQuery } from '@/hooks/use-fip-query'
27
+
28
+ interface BankAccount {
29
+ linkRefNumber: string;
30
+ fiType: string;
31
+ bankName: string;
32
+ accountType: string;
33
+ maskedAccNumber: string;
34
+ logoUrl?: string;
35
+ fipHandle: string;
36
+ }
37
+
38
+ const OldUser = () => {
39
+
40
+ useSetPageTitle('Select accounts you want to share')
41
+ const { setSelectedAccountToLink, setFips, setSignature, setOriginalAccounts, accountForConsent, setAccountForConsent, activeCategory, categories } = useFipStore();
42
+ const { decodedInfo } = useRedirectStore();
43
+ const consentHandle = decodedInfo?.srcref || '';
44
+ const { shouldAllowNavigation } = useNavigationBlock();
45
+ const navigate = useNavigate();
46
+
47
+ // Fetch FIP data with React Query - use dynamic consent handle
48
+ const { refetch } = useFipQuery(consentHandle)
49
+
50
+ const getLinkedAccountsList = useQuery({
51
+ queryKey: ['linked-accounts', consentHandle, decodedInfo?.fipId],
52
+ queryFn: () => accountService.getLinkedAccounts(consentHandle, decodedInfo?.fipId),
53
+ enabled: !!consentHandle,
54
+ select: (data) => {
55
+ return data.map((account: BankAccount) => ({
56
+ ...account,
57
+ bankName: account.fipName,
58
+ maskedAccountNumber: account.maskedAccNumber,
59
+ type: account.accountType,
60
+ id: account.accountRefNumber
61
+ }))
62
+ }
63
+ })
64
+
65
+ // Account discovery with enhanced error handling
66
+ const { mutate } = useAccountDiscovery()
67
+
68
+ // Group accounts by fiType
69
+ const groupedAccounts = React.useMemo(() => {
70
+ if (getLinkedAccountsList.isFetched && getLinkedAccountsList.data?.length === 0) {
71
+ shouldAllowNavigation()
72
+ navigate(`/link-accounts/${activeCategory ? activeCategory?.toLowerCase() : categories[0]?.toLowerCase()}`)
73
+ }
74
+ if (!getLinkedAccountsList?.data) return {};
75
+
76
+ const fipIdsArray = new Set(getLinkedAccountsList.data.map((account: BankAccount) => account.fipHandle));
77
+ setFips(Array.from(fipIdsArray));
78
+ let mounted = true
79
+
80
+ if (!accountForConsent?.length) {
81
+ setAccountForConsent([...new Set(getLinkedAccountsList.data.map((i => i?.linkRefNumber)))]);
82
+ }
83
+
84
+ mutate(Array.from(fipIdsArray), {
85
+ onSuccess: result => {
86
+ if (!mounted) return
87
+ const groupedAccounts = result.accounts.reduce(
88
+ (acc: Record<string, any[]>, account) => {
89
+ const key = account.type
90
+ if (!acc[key]) {
91
+ acc[key] = []
92
+ }
93
+ acc[key].push(account)
94
+ return acc
95
+ },
96
+ {}
97
+ )
98
+ setSignature(result.signature)
99
+ setOriginalAccounts(result.originalAccounts)
100
+ },
101
+ onError: () => {
102
+ if (!mounted) return
103
+ }
104
+ })
105
+
106
+ const accounts = getLinkedAccountsList.data;
107
+ return accounts.reduce((acc: any, account) => {
108
+ const fiType = account.fiType || 'Other';
109
+ if (!acc[fiType]) {
110
+ acc[fiType] = [];
111
+ }
112
+ acc[fiType].push(account);
113
+ return acc;
114
+ }, {});
115
+ }, [getLinkedAccountsList?.data]);
116
+
117
+ const toggleBankSelection = (bankId: string) => {
118
+ setAccountForConsent(accountForConsent.includes(bankId)
119
+ ? accountForConsent.filter(id => id !== bankId)
120
+ : [...accountForConsent, bankId]
121
+ );
122
+ };
123
+
124
+ const handleProceed = () => {
125
+ setSelectedAccountToLink(
126
+ getLinkedAccountsList?.data?.filter(account =>
127
+ accountForConsent.includes(account.linkRefNumber)
128
+ ) || []
129
+ )
130
+ // Navigate to account linking screen with selected accounts and signature
131
+ navigate('/review', {
132
+ state: {
133
+ selectedFips: accountForConsent,
134
+ }
135
+ })
136
+ }
137
+
138
+ const handleCancel = () => {
139
+ // Deselect all selected accounts
140
+ setAccountForConsent([]);
141
+ }
142
+
143
+ const handleSelectAll = (fiType: string) => {
144
+ const accounts = groupedAccounts[fiType] || [];
145
+ const allAccountRefs = accounts.map((account: BankAccount) => account.linkRefNumber);
146
+
147
+ // Check if all accounts in this group are already selected
148
+ const areAllSelected = allAccountRefs.every((ref: string) => accountForConsent.includes(ref));
149
+
150
+ if (areAllSelected) {
151
+ // If all are selected, deselect all accounts in this group
152
+ setAccountForConsent(accountForConsent.filter(ref => !allAccountRefs.includes(ref)));
153
+ } else {
154
+ // If not all are selected, select all accounts in this group
155
+ setAccountForConsent([...new Set([...accountForConsent, ...allAccountRefs])]);
156
+ }
157
+ };
158
+
159
+ return (
160
+ <FrostedLayout>
161
+ <div className='w-full px-0 md:px-14'>
162
+ <div>
163
+ {(() => {
164
+ if (getLinkedAccountsList?.isLoading) {
165
+ return (
166
+ <div className='flex flex-col gap-4 md:mt-6 mt-0'>
167
+ <Skeleton className='h-8 w-[24%]' />
168
+ {Array(3)
169
+ .fill(0)
170
+ .map((_, index) => (
171
+ <OuterCard key={`loading-${index}`} selected={false} loading={true}>
172
+ <BankCard bankName='' />
173
+ </OuterCard>
174
+ ))}
175
+ <Skeleton className='h-16 w-full mt-3' />
176
+ </div>
177
+ );
178
+ }
179
+
180
+ if (getLinkedAccountsList?.data && getLinkedAccountsList.data.length > 0) {
181
+ return Object.keys(groupedAccounts).map((fiType) => (
182
+ <div key={fiType}>
183
+ <SectionTitle
184
+ title={fiType}
185
+ className="md:mt-6 mt-0"
186
+ rightSection={
187
+ <AnimatedButton
188
+ variant={'text'}
189
+ size={'text'}
190
+ className='text-primary'
191
+ onClick={() => handleSelectAll(fiType)}
192
+ >
193
+ {groupedAccounts[fiType]?.every((account: BankAccount) =>
194
+ accountForConsent.includes(account.linkRefNumber)
195
+ ) ? 'Deselect All' : 'Select All'}
196
+ </AnimatedButton>
197
+ }
198
+ />
199
+ <ScrollArea className='max-h-[40vh] overflow-y-auto'>
200
+ {groupedAccounts[fiType]?.map((account: BankAccount) => (
201
+ <div className='mt-2 flex flex-col gap-2' key={account.linkRefNumber}>
202
+ <OuterCard
203
+ selected={accountForConsent.includes(account.linkRefNumber)}
204
+ onSelect={() => toggleBankSelection(account.linkRefNumber)}>
205
+ <BankCard
206
+ bankName={account.bankName}
207
+ image={account.logoUrl}
208
+ subText={`${account.accountType} | **${formatAccountNumber(account.maskedAccNumber)}`}
209
+ rightSection={
210
+ <Checkbox
211
+ id={`checkbox-${account.linkRefNumber}`}
212
+ checked={accountForConsent.includes(account.linkRefNumber)}
213
+ onCheckedChange={() => toggleBankSelection(account.linkRefNumber)}
214
+ />
215
+ }
216
+ />
217
+ </OuterCard>
218
+ </div>
219
+ ))}
220
+ </ScrollArea>
221
+ <Button
222
+ variant={'outline'}
223
+ className='bg-primary-foreground text-primary border-primary hover:bg-primary/10 h-[50px] w-full mt-4 mb-6'
224
+ onClick={() => {
225
+ refetch()
226
+ navigate(`/link-accounts/${fiType.toLowerCase()}`, {
227
+ state: {
228
+ fiType,
229
+ }
230
+ });
231
+ setAccountForConsent([])
232
+ }}
233
+ size={'lg'}
234
+ >
235
+ <div className='flex items-center gap-2 text-md text-primary font-[600] dark:text-muted-secondary'>
236
+ <PlusIcon
237
+ strokeWidth='2.3'
238
+ className='size-5 text-primary dark:text-muted-secondary'
239
+ />{' '}
240
+ {t('discoverMore')}
241
+ </div>
242
+ </Button>
243
+ </div>
244
+ ));
245
+ }
246
+
247
+ return (
248
+ <>
249
+ <Alert variant='destructive' className='mb-4 mt-12'>
250
+ <AlertCircle className='h-4 w-4 mt-1' />
251
+ <AlertDescription className='flex items-center justify-between'>
252
+ Failed to find linked accounts
253
+ <Button
254
+ variant='outline'
255
+ size='sm'
256
+ className='ml-2'
257
+ onClick={() => {
258
+ getLinkedAccountsList.refetch()
259
+ }}
260
+ >
261
+ Retry
262
+ </Button>
263
+ </AlertDescription>
264
+ </Alert>
265
+ <Button
266
+ variant={'secondary'}
267
+ className='bg-gray-200 dark:bg-gray-800 text-gray-700 hover:bg-gray-300 h-[50px] w-full mt-4'
268
+ onClick={() => {
269
+ refetch()
270
+ navigate(`/link-accounts/${completedCategories?.[completedCategories.length - 1]}`);
271
+ }}
272
+ size={'lg'}
273
+ >
274
+ <div className='flex items-center gap-2 text-md text-consent-primary font-[600] capitalize'>
275
+ <PlusIcon
276
+ strokeWidth='2.3'
277
+ className='size-5 text-consent-primary'
278
+ />{' '}
279
+ {t('discover')}
280
+ </div>
281
+ </Button>
282
+ </>
283
+ );
284
+ })()}
285
+ </div>
286
+ <DummyFooter />
287
+ </div>
288
+
289
+ <MobileFooter show={accountForConsent.length > 0}>
290
+ <div className='flex flex-col items-center w-full gap-4'>
291
+ <AnimatedButton
292
+ onClick={handleProceed}
293
+ size='lg'
294
+ className='w-full h-[50px]'
295
+ >
296
+ {t('proceed')}
297
+ </AnimatedButton>
298
+ <AnimatedButton
299
+ onClick={handleCancel}
300
+ variant={'ghost'}
301
+ size='lg'
302
+ className='text-primary'
303
+ >
304
+ {t('cancel')}
305
+ </AnimatedButton>
306
+ </div>
307
+ </MobileFooter>
308
+
309
+ <WebFooter show={accountForConsent.length > 0}>
310
+ <AnimatedButton
311
+ onClick={handleCancel}
312
+ variant={'ghost'}
313
+ size='lg'
314
+ className='text-primary'
315
+ >
316
+ Cancel
317
+ </AnimatedButton>
318
+ <AnimatedButton
319
+ onClick={handleProceed}
320
+ size='lg'
321
+ >
322
+ Proceed
323
+ </AnimatedButton>
324
+ </WebFooter>
325
+ </FrostedLayout>
326
+ )
327
+ }
328
+
329
+ export default OldUser