@opexa/portal-components 0.0.69 → 0.0.71

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 (126) hide show
  1. package/dist/client/hooks/useGamesQuery.d.ts +2 -2
  2. package/dist/client/hooks/useGamesQuery.js +2 -2
  3. package/dist/components/Account/Account.d.ts +2 -0
  4. package/dist/components/Account/Account.js +17 -16
  5. package/dist/components/BetRecords/BetRecords.js +10 -15
  6. package/dist/components/GameProviders/GameProviders.d.ts +14 -2
  7. package/dist/components/GameProviders/GameProviders.js +12 -2
  8. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +1 -9
  9. package/dist/components/Jackpots/JackpotItemDesktop.js +5 -3
  10. package/dist/components/Jackpots/JackpotItemMobile.d.ts +1 -9
  11. package/dist/components/Jackpots/JackpotItemMobile.js +5 -3
  12. package/dist/components/Jackpots/JackpotRules.d.ts +0 -1
  13. package/dist/components/Jackpots/JackpotRules.js +3 -1
  14. package/dist/components/Jackpots/Jackpots.client.js +2 -1
  15. package/dist/components/Jackpots/Jackpots.d.ts +3 -5
  16. package/dist/components/Jackpots/JackpotsContext.d.ts +4 -0
  17. package/dist/components/Jackpots/JackpotsContext.js +3 -0
  18. package/dist/components/Jackpots/useJackpotItemData.d.ts +2 -8
  19. package/dist/components/Jackpots/useJackpotItemData.js +7 -1
  20. package/dist/components/Search/Search.d.ts +15 -0
  21. package/dist/components/Search/Search.js +32 -5
  22. package/dist/components/TopWins/TopWins.client.js +3 -3
  23. package/dist/components/Tournaments/TournamentDesktop.d.ts +1 -0
  24. package/dist/components/Tournaments/TournamentDesktop.js +57 -0
  25. package/dist/components/Tournaments/TournamentMobile.d.ts +1 -0
  26. package/dist/components/Tournaments/TournamentMobile.js +55 -0
  27. package/dist/components/Tournaments/TournamentRules.d.ts +0 -1
  28. package/dist/components/Tournaments/TournamentRules.js +3 -1
  29. package/dist/components/Tournaments/Tournaments.client.js +4 -3
  30. package/dist/components/Tournaments/Tournaments.d.ts +2 -4
  31. package/dist/components/Tournaments/TournamentsContext.d.ts +4 -0
  32. package/dist/components/Tournaments/TournamentsContext.js +3 -0
  33. package/dist/components/Tournaments/useTournamentData.d.ts +10 -0
  34. package/dist/components/Tournaments/useTournamentData.js +72 -0
  35. package/dist/components/TransactionRecords/DepositRecordsTable.js +1 -0
  36. package/dist/components/TransactionRecords/TableFilters.d.ts +1 -7
  37. package/dist/components/TransactionRecords/TableFilters.js +1 -53
  38. package/dist/components/TransactionRecords/TransactionRecords.d.ts +0 -3
  39. package/dist/components/TransactionRecords/TransactionRecords.js +0 -1
  40. package/dist/components/TransactionRecords/TransactionRecordsTable.js +1 -0
  41. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +1 -0
  42. package/dist/constants/envVars.d.ts +5 -0
  43. package/dist/constants/envVars.js +28 -0
  44. package/dist/constants/gameProviders.d.ts +4 -0
  45. package/dist/constants/gameProviders.js +311 -0
  46. package/dist/constants/gameTypes.d.ts +4 -0
  47. package/dist/constants/gameTypes.js +64 -0
  48. package/dist/constants/headerKeys.d.ts +1 -0
  49. package/dist/constants/headerKeys.js +1 -0
  50. package/dist/constants/index.d.ts +6 -12
  51. package/dist/constants/index.js +6 -88
  52. package/dist/constants/secretQuestions.d.ts +3 -0
  53. package/dist/constants/secretQuestions.js +24 -0
  54. package/dist/constants/storageKeys.d.ts +2 -0
  55. package/dist/constants/storageKeys.js +2 -0
  56. package/dist/images/game-providers/ALIZE.png +0 -0
  57. package/dist/images/game-providers/BGAMING.png +0 -0
  58. package/dist/images/game-providers/BOOOONGO.png +0 -0
  59. package/dist/images/game-providers/BTI.png +0 -0
  60. package/dist/images/game-providers/CQ9.png +0 -0
  61. package/dist/images/game-providers/DG.png +0 -0
  62. package/dist/images/game-providers/E2E.png +0 -0
  63. package/dist/images/game-providers/EVOLUTION_NETENT.png +0 -0
  64. package/dist/images/game-providers/EVOPLAY.png +0 -0
  65. package/dist/images/game-providers/EZUGI.png +0 -0
  66. package/dist/images/game-providers/FACHAI.png +0 -0
  67. package/dist/images/game-providers/HABANERO.png +0 -0
  68. package/dist/images/game-providers/HACKSAW.png +0 -0
  69. package/dist/images/game-providers/JDB.png +0 -0
  70. package/dist/images/game-providers/JDB_GTF.png +0 -0
  71. package/dist/images/game-providers/JDB_SPRIBE.png +0 -0
  72. package/dist/images/game-providers/JILI.png +0 -0
  73. package/dist/images/game-providers/JOKER.png +0 -0
  74. package/dist/images/game-providers/KINGMAKER.png +0 -0
  75. package/dist/images/game-providers/KINGMIDAS.png +0 -0
  76. package/dist/images/game-providers/MICROGAMING.png +0 -0
  77. package/dist/images/game-providers/ONEAPI.png +0 -0
  78. package/dist/images/game-providers/PGSOFT.png +0 -0
  79. package/dist/images/game-providers/PLAYTECH.png +0 -0
  80. package/dist/images/game-providers/PRAGMATIC_PLAY.png +0 -0
  81. package/dist/images/game-providers/RELAX_GAMING.png +0 -0
  82. package/dist/images/game-providers/SABA.png +0 -0
  83. package/dist/images/game-providers/SPINIX.png +0 -0
  84. package/dist/images/game-providers/SPRIBE.png +0 -0
  85. package/dist/images/game-providers/YELLOWBAT.png +0 -0
  86. package/dist/server/utils/prefetchGamesQuery.d.ts +2 -2
  87. package/dist/server/utils/prefetchGamesQuery.js +2 -2
  88. package/dist/types/index.d.ts +6 -1
  89. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  90. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  91. package/dist/ui/Badge/Badge.d.ts +12 -12
  92. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  93. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  94. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  95. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  96. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  97. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  98. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  99. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  100. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  101. package/dist/ui/DatePicker/DatePicker.d.ts +336 -336
  102. package/dist/ui/DatePicker/datePicker.recipe.d.ts +14 -14
  103. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  104. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  105. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  106. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  107. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  108. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  109. package/dist/ui/Popover/Popover.d.ts +88 -88
  110. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  111. package/dist/ui/Progress/Progress.d.ts +27 -27
  112. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  113. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  114. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  115. package/dist/ui/Select/Select.d.ts +45 -45
  116. package/dist/ui/Select/select.recipe.d.ts +3 -3
  117. package/dist/ui/Table/Table.d.ts +21 -21
  118. package/dist/ui/Table/table.recipe.d.ts +3 -3
  119. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  120. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  121. package/dist/utils/callIfFn.d.ts +1 -0
  122. package/dist/utils/callIfFn.js +6 -0
  123. package/dist/utils/index.d.ts +1 -0
  124. package/dist/utils/index.js +1 -0
  125. package/dist/utils/queryKeys.d.ts +2 -2
  126. package/package.json +6 -3
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Image from 'next/image';
3
+ import React from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { Trophy01Icon, User01Icon } from '../../icons/index.js';
6
+ import { Award01Icon } from '../../icons/Award01Icon.js';
7
+ import { StarIcon } from '../../icons/StarIcon.js';
8
+ import firstPlace from '../../images/first-place.png';
9
+ import trophyTwo from '../../images/trophy-two.png';
10
+ import trophy from '../../images/trophy.png';
11
+ import { formatNumber, mask } from '../../utils/index.js';
12
+ import styles from '../JackpotCounter/JackpotCounterItem.module.css';
13
+ import { TournamentGameProviders } from './TournamentGameProviders.js';
14
+ import { TournamentRules } from './TournamentRules.js';
15
+ import { useTournamentContext } from './TournamentsContext.js';
16
+ import { useTournamentData } from './useTournamentData.js';
17
+ export function TournamentItemDesktop() {
18
+ const tournament = useTournamentContext();
19
+ const { prizeAmountsByRank, timeParts, tournamentReward, filteredGameProviders, localeInfo, } = useTournamentData();
20
+ return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border'), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-6 lg:p-5'), children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(Award01Icon, { className: "text-utility-brand-500 size-3.5" }), "Multiplier"] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
21
+ currency: localeInfo.currency.code,
22
+ minDecimalPlaces: 2,
23
+ maxDecimalPlaces: 2,
24
+ }) })] }), _jsx("div", { className: "z-1 bottom-[-60] right-0 block lg:absolute", children: _jsx("div", { className: "h-[155px] w-auto shrink-0", children: _jsx(Image, { quality: 100, width: 155, height: 155, src: trophy, alt: "trophy", className: "px-6 py-2.5" }) }) })] }), tournament.topPayouts.length ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsxs("div", { className: "bg-bg-tertiary relative flex h-18 w-18 items-center justify-center rounded-full", children: [_jsx(User01Icon, { className: "text-text-quarterary-500 size-9" }), _jsx("div", { className: "bg-yellow-400 text-brand-950 border-bg-primary absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] text-xs font-bold", children: "1st" })] }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: mask(tournament?.topPayouts[0]?.member?.name || '') }), _jsx("div", { className: "text-brand-400 text-2xl", children: formatNumber(tournament?.topPayouts[0]?.amount, {
25
+ currency: localeInfo.currency.code,
26
+ minDecimalPlaces: 2,
27
+ maxDecimalPlaces: 2,
28
+ }) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the tournament!" })] })] }))] }) }) }) }), _jsxs("div", { className: "z-1 hidden flex-1 space-y-4 lg:block", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Image, { width: 24, height: 24, src: trophyTwo, quality: 100, alt: "leaderboardIcon", className: "size-full w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: tournament.currentLeaderboard.edges.length
29
+ ? 'Leaderboard'
30
+ : 'Starting soon!' })] }), _jsx(TournamentRules, {})] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
31
+ currency: localeInfo.currency.code,
32
+ minDecimalPlaces: 2,
33
+ maxDecimalPlaces: 2,
34
+ }) })) : (_jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }))] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 10 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] })] }), Boolean(filteredGameProviders.length) && (_jsx(TournamentGameProviders, { gameProviders: filteredGameProviders }))] }));
35
+ }
36
+ const starTierStyles = [
37
+ {
38
+ starColor: 'text-yellow-400',
39
+ numberColor: 'text-bg-primary',
40
+ },
41
+ {
42
+ starColor: 'text-utility-gray-700',
43
+ numberColor: 'text-bg-primary',
44
+ },
45
+ {
46
+ starColor: 'text-yellow-700',
47
+ numberColor: 'text-bg-primary',
48
+ },
49
+ {
50
+ starColor: 'text-bg-quaternary',
51
+ numberColor: 'text-text-primary-900',
52
+ },
53
+ {
54
+ starColor: 'text-bg-quaternary',
55
+ numberColor: 'text-text-primary-900',
56
+ },
57
+ ];
@@ -0,0 +1 @@
1
+ export declare function TournamentItemMobile(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Image from 'next/image';
3
+ import React, { useState } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { ArrowNarrowDownIcon, ArrowNarrowUpIcon, Award01Icon, StarIcon, Trophy01Icon, User01Icon, } from '../../icons/index.js';
6
+ import firstPlace from '../../images/first-place.png';
7
+ import trophy from '../../images/trophy.png';
8
+ import { Button } from '../../ui/index.js';
9
+ import { formatNumber, mask } from '../../utils/index.js';
10
+ import { TournamentGameProviders } from './TournamentGameProviders.js';
11
+ import { TournamentRules } from './TournamentRules.js';
12
+ import { useTournamentContext } from './TournamentsContext.js';
13
+ import { useTournamentData } from './useTournamentData.js';
14
+ export function TournamentItemMobile() {
15
+ const tournament = useTournamentContext();
16
+ const [isDetailsVisible, setIsDetailsVisible] = useState(false);
17
+ const { prizeAmountsByRank, timeParts, tournamentReward, filteredGameProviders, localeInfo, } = useTournamentData();
18
+ return (_jsxs("div", { className: "bg-bg-primary border-border-primary rounded-2xl border", children: [_jsx("div", { className: twMerge('bg-bg-tertiary relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: _jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(Award01Icon, { className: "text-utility-brand-500 size-3.5" }), "Multiplier"] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-2.5 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
+ currency: localeInfo.currency.code,
20
+ minDecimalPlaces: 2,
21
+ maxDecimalPlaces: 2,
22
+ }) })] }), _jsx("div", { className: "z-1 absolute bottom-[-60] right-0", children: _jsx(Image, { width: 72.94, height: 93, src: trophy, alt: "trophy", quality: 100, className: "size-full" }) })] }) }) }) }), tournament.topPayouts.length ? (_jsx("div", { children: _jsxs("div", { className: "bg-bg-primary relative mt-4 flex w-full gap-4 rounded-lg p-4", children: [_jsxs("div", { className: "bg-bg-tertiary relative flex h-18 w-18 items-center justify-center rounded-full", children: [_jsx(User01Icon, { className: "text-text-quarterary-500 size-9" }), _jsx("div", { className: "bg-yellow-400 text-brand-950 border-bg-primary absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] text-xs font-bold", children: "1st" })] }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: mask(tournament?.topPayouts[0]?.member?.name || '') }), _jsx("div", { className: "text-brand-400 text-2xl", children: formatNumber(tournament?.topPayouts[0]?.amount, {
23
+ currency: localeInfo.currency.code,
24
+ minDecimalPlaces: 2,
25
+ maxDecimalPlaces: 2,
26
+ }) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 flex w-full gap-4 rounded-lg p-4", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the tournament!" })] })] })), _jsx(Button, { variant: "outline", className: twMerge('mt-5.5 px-3.5 py-2.5 text-sm', isDetailsVisible ? 'hidden' : 'flex'), onClick: () => setIsDetailsVisible(!isDetailsVisible), children: _jsxs("div", { className: "flex gap-1.5", children: ["See Details", _jsx(ArrowNarrowDownIcon, { className: "size-5" })] }) })] }) }), isDetailsVisible && (_jsxs("div", { children: [_jsxs("div", { className: "z-1 flex-1", children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsx("div", { className: "flex gap-2", children: _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: tournament.currentLeaderboard.edges.length
27
+ ? 'Leaderboard'
28
+ : 'Starting soon!' }) }), _jsx(TournamentRules, {})] }), _jsx("div", { children: _jsx("div", { className: "border-gray-200 overflow-hidden", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-center text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-center text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
29
+ currency: localeInfo.currency.code,
30
+ minDecimalPlaces: 2,
31
+ maxDecimalPlaces: 2,
32
+ }) })) : (_jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }))] }, i))) })) : (_jsx(_Fragment, { children: Array.from({ length: 5 }).map((_, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-center text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: "-" })] }, i))) })) })] }) }) })] }), Boolean(filteredGameProviders.length) && (_jsx(TournamentGameProviders, { gameProviders: filteredGameProviders })), _jsx("div", { className: "m-3", children: _jsx(Button, { variant: "outline", className: twMerge('px-3.5 py-2.5 text-sm', !isDetailsVisible ? 'hidden' : 'flex'), onClick: () => setIsDetailsVisible(!isDetailsVisible), children: _jsxs("div", { className: "flex gap-1.5", children: ["Hide", _jsx(ArrowNarrowUpIcon, { className: "size-5" })] }) }) })] }))] }));
33
+ }
34
+ const starTierStyles = [
35
+ {
36
+ starColor: 'text-yellow-400',
37
+ numberColor: 'text-bg-primary',
38
+ },
39
+ {
40
+ starColor: 'text-utility-gray-700',
41
+ numberColor: 'text-bg-primary',
42
+ },
43
+ {
44
+ starColor: 'text-yellow-700',
45
+ numberColor: 'text-bg-primary',
46
+ },
47
+ {
48
+ starColor: 'text-bg-quaternary',
49
+ numberColor: 'text-text-primary-900',
50
+ },
51
+ {
52
+ starColor: 'text-bg-quaternary',
53
+ numberColor: 'text-text-primary-900',
54
+ },
55
+ ];
@@ -1,6 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export interface TournamentRulesProps {
3
3
  children?: ReactNode;
4
- jackpotRules: string;
5
4
  }
6
5
  export declare function TournamentRules(props: TournamentRulesProps): import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,8 @@ import { Portal } from '@ark-ui/react';
4
4
  import { XIcon } from '../../icons/index.js';
5
5
  import { Flag06Icon } from '../../icons/Flag06Icon.js';
6
6
  import { Dialog } from '../../ui/index.js';
7
+ import { useTournamentContext } from './TournamentsContext.js';
7
8
  export function TournamentRules(props) {
8
- return (_jsxs(Dialog.Root, { lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: [_jsx(Dialog.Trigger, { asChild: true, children: props.children ?? (_jsx("button", { type: "button", className: "text-button-tertiary-fg flex text-sm font-semibold", children: "Tournament Rules" })) }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto h-full w-full items-start lg:h-auto lg:w-[640px] lg:rounded-xl", children: [_jsxs("div", { className: "p-3xl", children: [_jsxs("div", { className: "mb-3 flex justify-between", children: [_jsx("div", { className: "bg-bg-tertiary border-border-primary flex h-12 w-12 items-center justify-center rounded-lg border", children: _jsx(Flag06Icon, { className: "text-text-tertiary-600 size-full p-3" }) }), _jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) })] }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: "Tournament Rules" }), _jsx("div", { className: "text-text-tertiary-600 mt-1 text-sm", children: "Terms and Conditions" })] }), _jsx("div", { className: "border-gray-800 border-t-1 pb-3", children: _jsx("div", { dangerouslySetInnerHTML: { __html: props.jackpotRules }, className: "px-3xl py-3" }) })] }) })] })] }));
9
+ const tournament = useTournamentContext();
10
+ return (_jsxs(Dialog.Root, { lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: [_jsx(Dialog.Trigger, { asChild: true, children: props.children ?? (_jsx("button", { type: "button", className: "text-button-tertiary-fg flex text-sm font-semibold", children: "Tournament Rules" })) }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt mx-auto h-full w-full items-start lg:h-auto lg:w-[640px] lg:rounded-xl", children: [_jsxs("div", { className: "p-3xl", children: [_jsxs("div", { className: "mb-3 flex justify-between", children: [_jsx("div", { className: "bg-bg-tertiary border-border-primary flex h-12 w-12 items-center justify-center rounded-lg border", children: _jsx(Flag06Icon, { className: "text-text-tertiary-600 size-full p-3" }) }), _jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) })] }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: "Tournament Rules" }), _jsx("div", { className: "text-text-tertiary-600 mt-1 text-sm", children: "Terms and Conditions" })] }), _jsx("div", { className: "border-gray-800 border-t-1 pb-3", children: _jsx("div", { dangerouslySetInnerHTML: { __html: tournament.description }, className: "px-3xl py-3" }) })] }) })] })] }));
9
11
  }
@@ -3,8 +3,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import Image from 'next/image';
4
4
  import { useTournamentsQuery } from '../../client/hooks/index.js';
5
5
  import closeChest from '../../images/close-chest.png';
6
- import { TournamentItemDesktop } from './TournamentItemDesktop.js';
7
- import { TournamentItemMobile } from './TournamentItemMobile.js';
6
+ import { TournamentItemDesktop } from './TournamentDesktop.js';
7
+ import { TournamentItemMobile } from './TournamentMobile.js';
8
+ import { TournamentContext, TournamentsPropsContext, } from './TournamentsContext.js';
8
9
  export function Tournaments__client(props) {
9
10
  const tournamentsQuery = useTournamentsQuery({
10
11
  first: 100,
@@ -15,5 +16,5 @@ export function Tournaments__client(props) {
15
16
  },
16
17
  });
17
18
  const tournaments = tournamentsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
18
- return (_jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Tournaments' }), tournaments.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: tournaments.map((tournament, i) => (_jsx(TournamentItemDesktop, { tournament: tournament, gameProviders: props.gameProviders }, i))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: tournaments.map((tournament, i) => (_jsx(TournamentItemMobile, { tournament: tournament, gameProviders: props.gameProviders }, i))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'tournaments', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }));
19
+ return (_jsx(TournamentsPropsContext, { value: props, children: _jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Tournaments' }), tournaments.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: tournaments.map((tournament) => (_jsx(TournamentContext, { value: tournament, children: _jsx(TournamentItemDesktop, {}) }, tournament.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: tournaments.map((tournament) => (_jsx(TournamentContext, { value: tournament, children: _jsx(TournamentItemMobile, {}) }, tournament.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'tournaments', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
19
20
  }
@@ -1,10 +1,8 @@
1
- import type { GameProviderData } from '../../types';
1
+ import type { GameProvider } from '@opexa/portal-sdk-core';
2
2
  export interface TournamentsProps {
3
3
  /** @default "Tournaments" */
4
4
  heading?: string;
5
- /** @default "/tournaments" */
6
- viewAllUrl?: string;
7
5
  className?: string;
8
- gameProviders: GameProviderData[];
6
+ gameProviders: GameProvider[];
9
7
  }
10
8
  export declare function Tournaments(props: TournamentsProps): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,4 @@
1
+ import type { Tournament } from '@opexa/portal-sdk-core';
2
+ import type { TournamentsProps } from './Tournaments';
3
+ export declare const TournamentsPropsContext: import("react").Context<TournamentsProps>, useTournamentsPropsContext: () => TournamentsProps;
4
+ export declare const TournamentContext: import("react").Context<Tournament>, useTournamentContext: () => Tournament;
@@ -0,0 +1,3 @@
1
+ import { createContext } from '../../client/utils/index.js';
2
+ export const [TournamentsPropsContext, useTournamentsPropsContext] = createContext();
3
+ export const [TournamentContext, useTournamentContext] = createContext();
@@ -0,0 +1,10 @@
1
+ export declare function useTournamentData(): {
2
+ timeParts: {
3
+ label: string;
4
+ value: number;
5
+ }[];
6
+ tournamentReward: number;
7
+ prizeAmountsByRank: number[];
8
+ filteredGameProviders: import("../../types").GameProviderData[];
9
+ localeInfo: import("../../utils").LocaleInfo;
10
+ };
@@ -0,0 +1,72 @@
1
+ // useJackpotItemData.ts
2
+ import { pick } from 'lodash-es';
3
+ import React, { useEffect, useMemo, useState } from 'react';
4
+ import { useLocaleInfo } from '../../client/hooks/index.js';
5
+ import { GAME_PROVIDER_DATA } from '../../constants/index.js';
6
+ import { useTournamentContext, useTournamentsPropsContext, } from './TournamentsContext.js';
7
+ export function useTournamentData() {
8
+ const tournamentsProps = useTournamentsPropsContext();
9
+ const tournament = useTournamentContext();
10
+ const gameProviders = tournamentsProps.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
11
+ const localeInfo = useLocaleInfo();
12
+ const [timeRemaining, setTimeRemaining] = useState({
13
+ days: 0,
14
+ hours: 0,
15
+ minutes: 0,
16
+ seconds: 0,
17
+ isPast: false,
18
+ });
19
+ const activationEndDateTime = useMemo(() => new Date(tournament.activationEndDateTime), [tournament.activationEndDateTime]);
20
+ const calculateRemainingTime = React.useCallback(() => {
21
+ const now = new Date();
22
+ const diffMs = activationEndDateTime.getTime() - now.getTime();
23
+ if (diffMs <= 0) {
24
+ setTimeRemaining({
25
+ days: 0,
26
+ hours: 0,
27
+ minutes: 0,
28
+ seconds: 0,
29
+ isPast: true,
30
+ });
31
+ return;
32
+ }
33
+ const diffSeconds = Math.floor(diffMs / 1000);
34
+ const days = Math.floor(diffSeconds / (3600 * 24));
35
+ const hours = Math.floor((diffSeconds % (3600 * 24)) / 3600);
36
+ const minutes = Math.floor((diffSeconds % 3600) / 60);
37
+ const seconds = diffSeconds % 60;
38
+ const updated = pick({ days, hours, minutes, seconds, isPast: false }, [
39
+ 'days',
40
+ 'hours',
41
+ 'minutes',
42
+ 'seconds',
43
+ 'isPast',
44
+ ]);
45
+ setTimeRemaining(updated);
46
+ }, [activationEndDateTime]);
47
+ useEffect(() => {
48
+ calculateRemainingTime();
49
+ const interval = setInterval(calculateRemainingTime, 1000); // Update every second
50
+ return () => clearInterval(interval);
51
+ }, [activationEndDateTime, calculateRemainingTime]);
52
+ const timeParts = [
53
+ { label: 'Day', value: timeRemaining.days },
54
+ { label: 'Hour', value: timeRemaining.hours },
55
+ { label: 'Min', value: timeRemaining.minutes },
56
+ { label: 'Sec', value: timeRemaining.seconds },
57
+ ];
58
+ const tournamentReward = Object.values(tournament.rewardSettings)
59
+ .map(Number)
60
+ .reduce((sum, val) => sum + val, 0);
61
+ const prizeAmountsByRank = Object.values(tournament.rewardSettings).map(Number);
62
+ const filteredGameProviders = gameProviders.filter((provider) => {
63
+ return tournament.enabledGameProviders.includes(provider.id);
64
+ });
65
+ return {
66
+ timeParts,
67
+ tournamentReward,
68
+ prizeAmountsByRank,
69
+ filteredGameProviders,
70
+ localeInfo,
71
+ };
72
+ }
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { tz, TZDateMini } from '@date-fns/tz';
3
4
  import {} from '@opexa/portal-sdk-core';
@@ -1,17 +1,13 @@
1
- import type { DepositStatus, GameProvider, GameType, TransactionType, WithdrawalStatus } from '@opexa/portal-sdk-core';
1
+ import type { DepositStatus, TransactionType, WithdrawalStatus } from '@opexa/portal-sdk-core';
2
2
  import type { DateRange } from '../../types';
3
3
  interface EnabledFilters {
4
4
  timestamp?: boolean;
5
- gameType?: boolean;
6
- gameProvider?: boolean;
7
5
  depositStatus?: boolean;
8
6
  withdrawalStatus?: boolean;
9
7
  transactionType?: boolean;
10
8
  }
11
9
  interface Value {
12
10
  timestamp?: Partial<DateRange> | null;
13
- gameType?: GameType | null;
14
- gameProvider?: GameProvider | null;
15
11
  depositStatus?: DepositStatus | null;
16
12
  withdrawalStatus?: WithdrawalStatus | null;
17
13
  transactionType?: TransactionType | null;
@@ -21,8 +17,6 @@ interface TableFiltersProps {
21
17
  defaultValue?: Value;
22
18
  onChange?: (value: Value) => void;
23
19
  enabledFilters?: EnabledFilters;
24
- gameTypeOptions?: GameType[];
25
- gameProviderOptions?: GameProvider[];
26
20
  }
27
21
  export declare function TableFilters(props: TableFiltersProps): import("react/jsx-runtime").JSX.Element;
28
22
  export {};
@@ -33,20 +33,6 @@ const TRANSACTION_TYPES = [
33
33
  ];
34
34
  const deviceTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
35
35
  export function TableFilters(props) {
36
- const gameTypeCollection = createListCollection({
37
- items: props.gameTypeOptions ?? [],
38
- itemToValue: (item) => item,
39
- itemToString: (item) => capitalize(item, {
40
- delimiter: capitalize.delimiters.UNDERSCORE,
41
- }),
42
- });
43
- const gameProviderCollection = createListCollection({
44
- items: props.gameProviderOptions ?? [],
45
- itemToValue: (item) => item,
46
- itemToString: (item) => capitalize(item, {
47
- delimiter: capitalize.delimiters.UNDERSCORE,
48
- }),
49
- });
50
36
  const depositStatusCollection = createListCollection({
51
37
  items: DEPOSIT_STATUSES,
52
38
  itemToValue: (item) => item,
@@ -72,8 +58,6 @@ export function TableFilters(props) {
72
58
  const handleChange = (next) => {
73
59
  const prev = {
74
60
  timestamp,
75
- gameType,
76
- gameProvider,
77
61
  depositStatus,
78
62
  withdrawalStatus,
79
63
  };
@@ -89,20 +73,6 @@ export function TableFilters(props) {
89
73
  handleChange({ timestamp });
90
74
  },
91
75
  });
92
- const [gameType, setGameType] = useControllableState({
93
- value: props.value?.gameType,
94
- defaultValue: props.defaultValue?.gameType ?? null,
95
- onChange(gameType) {
96
- handleChange({ gameType });
97
- },
98
- });
99
- const [gameProvider, setGameProvider] = useControllableState({
100
- value: props.value?.gameProvider,
101
- defaultValue: props.defaultValue?.gameProvider ?? null,
102
- onChange(gameProvider) {
103
- handleChange({ gameProvider });
104
- },
105
- });
106
76
  const [depositStatus, setDepositStatus] = useControllableState({
107
77
  value: props.value?.depositStatus,
108
78
  defaultValue: props.defaultValue?.depositStatus ?? null,
@@ -153,29 +123,7 @@ export function TableFilters(props) {
153
123
  setTimestamp(null);
154
124
  }
155
125
  setTab(value);
156
- }, className: "w-full lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "today", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "Today" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(DatePicker.Context, { children: (api) => (_jsx(SegmentGroup.Item, { value: "custom", onClick: () => api.setOpen(true), className: "w-full lg:w-auto", children: _jsxs(DatePicker.Control, { children: [_jsx(SegmentGroup.ItemText, { children: "Custom" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }) })) }), _jsx(SegmentGroup.Indicator, {})] }), _jsx(Portal, { children: _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) }) })] }), _jsx("div", { className: "hidden grow lg:block" }), props.enabledFilters?.gameType && (_jsxs(Select.Root, { collection: gameTypeCollection, value: gameType ? [gameType] : [], onValueChange: (details) => {
157
- const value = z
158
- .enum((props.gameTypeOptions ?? []))
159
- .safeParse(details.value.at(0)).data;
160
- setGameType(value ?? null);
161
- }, lazyMount: true, deselectable: true, positioning: {
162
- sameWidth: true,
163
- }, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Game Type" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
164
- e.stopPropagation();
165
- }, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: gameTypeCollection.items.map((type) => (_jsxs(Select.Item, { item: type, children: [_jsx(Select.ItemText, { children: capitalize(type, {
166
- delimiter: capitalize.delimiters.UNDERSCORE,
167
- }) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, type))) }) }) }) })] })), props.enabledFilters?.gameProvider && (_jsxs(Select.Root, { collection: gameProviderCollection, value: gameProvider ? [gameProvider] : [], onValueChange: (details) => {
168
- const value = z
169
- .enum((props.gameProviderOptions ?? []))
170
- .safeParse(details.value.at(0)).data;
171
- setGameProvider(value ?? null);
172
- }, lazyMount: true, deselectable: true, positioning: {
173
- sameWidth: true,
174
- }, children: [_jsxs(Select.Trigger, { className: "w-full lg:w-[14rem]", children: [_jsx(Select.ValueText, { placeholder: "Game Vendor" }), _jsx(Select.Context, { children: (api) => (_jsx(_Fragment, { children: api.value.length ? (_jsx(Select.ClearTrigger, { asChild: true, children: _jsx("span", { onClick: (e) => {
175
- e.stopPropagation();
176
- }, children: "Clear" }) })) : (_jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })) })) })] }), _jsx(Portal, { children: _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: _jsx(Select.ItemGroup, { children: gameProviderCollection.items.map((provider) => (_jsxs(Select.Item, { item: provider, children: [_jsx(Select.ItemText, { children: capitalize(provider, {
177
- delimiter: capitalize.delimiters.UNDERSCORE,
178
- }) }), _jsx(Select.ItemIndicator, { asChild: true, children: _jsx(CheckIcon, {}) })] }, provider))) }) }) }) })] })), props.enabledFilters?.depositStatus && (_jsxs(Select.Root, { collection: depositStatusCollection, value: depositStatus ? [depositStatus] : [], onValueChange: (details) => {
126
+ }, className: "w-full lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "all", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "All" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "today", className: "w-full lg:w-auto", children: [_jsx(SegmentGroup.ItemText, { children: "Today" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(DatePicker.Context, { children: (api) => (_jsx(SegmentGroup.Item, { value: "custom", onClick: () => api.setOpen(true), className: "w-full lg:w-auto", children: _jsxs(DatePicker.Control, { children: [_jsx(SegmentGroup.ItemText, { children: "Custom" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }) })) }), _jsx(SegmentGroup.Indicator, {})] }), _jsx(Portal, { children: _jsx(DatePicker.Positioner, { children: _jsx(DatePicker.Content, { children: _jsx(DatePicker.View, { view: "day", children: _jsx(DatePicker.Context, { children: (api) => (_jsxs(_Fragment, { children: [_jsxs(DatePicker.ViewControl, { children: [_jsx(DatePicker.PrevTrigger, { children: _jsx(ChevronLeftIcon, {}) }), _jsx(DatePicker.ViewTrigger, { children: _jsx(DatePicker.RangeText, {}) }), _jsx(DatePicker.NextTrigger, { children: _jsx(ChevronRightIcon, {}) })] }), _jsxs(DatePicker.Table, { children: [_jsx(DatePicker.TableHead, { children: _jsx(DatePicker.TableRow, { children: api.weekDays.map((weekDay, id) => (_jsx(DatePicker.TableHeader, { children: weekDay.short.substring(0, 2) }, id))) }) }), _jsx(DatePicker.TableBody, { children: api.weeks.map((week, id) => (_jsx(DatePicker.TableRow, { children: week.map((day, id) => (_jsx(DatePicker.TableCell, { value: day, children: _jsx(DatePicker.TableCellTrigger, { children: day.day }) }, id))) }, id))) })] })] })) }) }) }) }) })] }), _jsx("div", { className: "hidden grow lg:block" }), props.enabledFilters?.depositStatus && (_jsxs(Select.Root, { collection: depositStatusCollection, value: depositStatus ? [depositStatus] : [], onValueChange: (details) => {
179
127
  const value = z
180
128
  .enum(DEPOSIT_STATUSES)
181
129
  .safeParse(details.value.at(0)).data;
@@ -1,7 +1,4 @@
1
- import type { GameProvider, GameType } from '@opexa/portal-sdk-core';
2
1
  export interface TransactionRecordsProps {
3
- gameTypes: GameType[];
4
- gameProviders: GameProvider[];
5
2
  className?: string;
6
3
  }
7
4
  export declare function TransactionRecords(props: TransactionRecordsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- 'use client';
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { Tabs } from '../../ui/index.js';
4
3
  import { DepositRecordsTable } from './DepositRecordsTable.js';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { tz, TZDateMini } from '@date-fns/tz';
3
4
  import { endOfDay, format, startOfDay } from 'date-fns';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { tz, TZDateMini } from '@date-fns/tz';
3
4
  import { endOfDay, format, startOfDay } from 'date-fns';
@@ -0,0 +1,5 @@
1
+ export declare const SITE_ID: string;
2
+ export declare const PLATFORM_ID: string;
3
+ export declare const PLATFORM_CODE: string;
4
+ export declare const ENVIRONMENT: "production" | "development";
5
+ export declare const BYPASS_RECAPTCHA: boolean;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ export const SITE_ID = z
3
+ .string()
4
+ .min(1, 'Environment variable "NEXT_PUBLIC_SITE_ID" must be 1 or more characters')
5
+ .max(32, 'Environment variable "NEXT_PUBLIC_SITE_ID" must not be more than 32 characters')
6
+ .trim()
7
+ .parse(process.env.NEXT_PUBLIC_SITE_ID);
8
+ export const PLATFORM_ID = z
9
+ .string()
10
+ .min(1, 'Environment variable "NEXT_PUBLIC_PLATFORM_ID" must be 1 or more characters')
11
+ .max(32, 'Environment variable "NEXT_PUBLIC_PLATFORM_ID" must not be more than 32 characters')
12
+ .trim()
13
+ .parse(process.env.NEXT_PUBLIC_PLATFORM_ID);
14
+ export const PLATFORM_CODE = z
15
+ .string()
16
+ .min(4, 'Environment variable "NEXT_PUBLIC_PLATFORM_CODE" must be at least 4 characters')
17
+ .max(8, 'Environment variable "NEXT_PUBLIC_PLATFORM_CODE" must not be more than 8 characters')
18
+ .trim()
19
+ .parse(process.env.NEXT_PUBLIC_PLATFORM_CODE);
20
+ export const ENVIRONMENT = z
21
+ .enum(['production', 'development'])
22
+ .catch('development')
23
+ .parse(process.env.NEXT_PUBLIC_ENVIRONMENT);
24
+ export const BYPASS_RECAPTCHA = z
25
+ .any()
26
+ .transform(Boolean)
27
+ .catch(false)
28
+ .parse(process.env.NEXT_PUBLIC_BYPASS_RECAPTCHA);
@@ -0,0 +1,4 @@
1
+ import type { GameProvider } from '@opexa/portal-sdk-core';
2
+ import type { GameProviderData } from '../types';
3
+ export declare const GAME_PROVIDER_DATA: Record<GameProvider, GameProviderData>;
4
+ export declare const LEGACY_GAME_PROVIDERS: ["JILI", "PGSOFT", "FACHAI", "BTI", "DG", "PLAYTECH", "E2E", "ONEAPI_EVOLUTION", "CQ9", "JDB", "HABANERO", "SPINIX", "JOKER", "HACKSAW", "EVOLUTIONNETENT", "JDBGTF", "JDBSPRIBE", "MICROGAMING", "RELAXGAMING", "EVOPLAY", "BOOONGO", "BGAMING", "KINGMAKER", "KINGMIDAS", "YELLOWBAT", "ETENGJUE", "SABA", "PRAGMATICPLAY", "SPRIBE", "EZUGI", "ALIZE"];