@opexa/portal-components 0.0.55 → 0.0.57

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 (81) hide show
  1. package/dist/components/AccountPaymentMethods/AccountPaymentMethods.d.ts +1 -0
  2. package/dist/components/AccountPaymentMethods/AccountPaymentMethods.js +3 -0
  3. package/dist/components/AccountPaymentMethods/index.d.ts +1 -0
  4. package/dist/components/AccountPaymentMethods/index.js +1 -0
  5. package/dist/components/AccountVerification/AccountVerificationContext.d.ts +14 -0
  6. package/dist/components/AccountVerification/AccountVerificationContext.js +27 -0
  7. package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -0
  8. package/dist/components/AccountVerification/VerificationCapture.js +28 -0
  9. package/dist/components/AccountVerification/VerificationComplete.d.ts +1 -0
  10. package/dist/components/AccountVerification/VerificationComplete.js +9 -0
  11. package/dist/components/AccountVerification/VerificationDetails.d.ts +1 -0
  12. package/dist/components/AccountVerification/VerificationDetails.js +38 -0
  13. package/dist/components/GamesSearch/GamesSearchTrigger.d.ts +5 -0
  14. package/dist/components/GamesSearch/GamesSearchTrigger.js +14 -0
  15. package/dist/components/JackpotCounter/JackpotCounterItem.js +2 -0
  16. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -184
  17. package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
  18. package/dist/components/Jackpots/Jackpots.client.js +28 -0
  19. package/dist/components/Jackpots/Jackpots.d.ts +1 -1
  20. package/dist/components/Jackpots/Jackpots.js +6 -13
  21. package/dist/components/Jackpots/useJackpotItemData.js +2 -0
  22. package/dist/components/KYC/AccountVerificationContext.d.ts +14 -0
  23. package/dist/components/KYC/AccountVerificationContext.js +27 -0
  24. package/dist/components/KYC/VerificationCapture.d.ts +1 -0
  25. package/dist/components/KYC/VerificationCapture.js +28 -0
  26. package/dist/components/KYC/VerificationComplete.d.ts +1 -0
  27. package/dist/components/KYC/VerificationComplete.js +9 -0
  28. package/dist/components/KYC/VerificationDetails.d.ts +1 -0
  29. package/dist/components/KYC/VerificationDetails.js +38 -0
  30. package/dist/components/Promo/Promo.client.d.ts +2 -0
  31. package/dist/components/Promo/Promo.client.js +9 -0
  32. package/dist/components/Promo/Promo.js +2 -2
  33. package/dist/components/Promos/PromoCarousel.js +3 -3
  34. package/dist/components/Promos/PromoGrid.js +3 -4
  35. package/dist/components/Promos/PromoItem.d.ts +1 -1
  36. package/dist/components/Promos/PromoItem.js +5 -4
  37. package/dist/components/Promos/Promos.d.ts +1 -3
  38. package/dist/components/Promos/Promos.js +3 -1
  39. package/dist/components/Quests/Quests.client.d.ts +2 -0
  40. package/dist/components/Quests/Quests.client.js +27 -0
  41. package/dist/components/Quests/Quests.d.ts +1 -1
  42. package/dist/components/Quests/Quests.js +6 -26
  43. package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
  44. package/dist/components/Tournaments/Tournaments.client.js +19 -0
  45. package/dist/components/Tournaments/Tournaments.d.ts +1 -1
  46. package/dist/components/Tournaments/Tournaments.js +6 -11
  47. package/dist/server/utils/index.d.ts +1 -0
  48. package/dist/server/utils/index.js +1 -0
  49. package/dist/server/utils/prefetchAvailableQuestsQuery.d.ts +1 -0
  50. package/dist/server/utils/prefetchAvailableQuestsQuery.js +22 -0
  51. package/dist/styles/theme.css +696 -696
  52. package/dist/tsconfig.build.tsbuildinfo +1 -1
  53. package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
  54. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
  55. package/dist/ui/Badge/Badge.d.ts +12 -12
  56. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  57. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  58. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  59. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  60. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  61. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  62. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  63. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  64. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  65. package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
  66. package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
  67. package/dist/ui/Dialog/Dialog.d.ts +154 -154
  68. package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
  69. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  70. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  71. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  72. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  73. package/dist/ui/Popover/Popover.d.ts +88 -88
  74. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  75. package/dist/ui/Select/Select.d.ts +45 -45
  76. package/dist/ui/Select/select.recipe.d.ts +3 -3
  77. package/dist/ui/Table/Table.d.ts +21 -21
  78. package/dist/ui/Table/table.recipe.d.ts +3 -3
  79. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  80. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  81. package/package.json +156 -156
@@ -0,0 +1,14 @@
1
+ type Step = 1 | 2 | 3 | (number & {});
2
+ interface UseAccountVerificationReturn {
3
+ step: Step;
4
+ setStep: (step: Step) => void;
5
+ started: boolean;
6
+ setStarted: (started: boolean) => void;
7
+ completed: boolean;
8
+ setCompleted: (completed: boolean) => void;
9
+ reset: () => void;
10
+ }
11
+ export declare function useAccountVerification(): UseAccountVerificationReturn;
12
+ export declare const AccountVerificationContext: import("react").Context<UseAccountVerificationReturn | null>;
13
+ export declare function useAccountVerificationContext(): UseAccountVerificationReturn;
14
+ export {};
@@ -0,0 +1,27 @@
1
+ import { createContext, useContext, useState } from 'react';
2
+ import invariant from 'tiny-invariant';
3
+ export function useAccountVerification() {
4
+ const [step, setStep] = useState(1);
5
+ const [started, setStarted] = useState(false);
6
+ const [completed, setCompleted] = useState(false);
7
+ function reset() {
8
+ setStep(1);
9
+ setStarted(false);
10
+ setCompleted(false);
11
+ }
12
+ return {
13
+ step,
14
+ setStep,
15
+ started,
16
+ setStarted,
17
+ completed,
18
+ setCompleted,
19
+ reset,
20
+ };
21
+ }
22
+ export const AccountVerificationContext = createContext(null);
23
+ export function useAccountVerificationContext() {
24
+ const context = useContext(AccountVerificationContext);
25
+ invariant(context);
26
+ return context;
27
+ }
@@ -0,0 +1 @@
1
+ export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { noop } from 'lodash-es';
3
+ import Image from 'next/image';
4
+ import { ArrowLeftIcon, CheckIcon, XIcon } from '../../icons/index.js';
5
+ import uploadId from '../../images/capture-id-banner.png';
6
+ import selfie from '../../images/capture-selfie-banner.png';
7
+ import { Button, Checkbox, Field, Progress } from '../../ui/index.js';
8
+ import { useAccountVerificationContext } from './AccountVerificationContext.js';
9
+ export function VerificationCapture() {
10
+ const context = useAccountVerificationContext();
11
+ if (!context.started)
12
+ return null;
13
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(context.step - 1), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.completed ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), context.step === 3 && _jsx(Step3, {})] }));
14
+ }
15
+ function Step1() {
16
+ const context = useAccountVerificationContext();
17
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
18
+ }
19
+ function Step2() {
20
+ const context = useAccountVerificationContext();
21
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
22
+ }
23
+ function Step3() {
24
+ const context = useAccountVerificationContext();
25
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => {
26
+ context.setCompleted(true);
27
+ }, children: "Continue" }) })] })] }));
28
+ }
@@ -0,0 +1 @@
1
+ export declare function VerificationComplete(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Portal } from '@ark-ui/react';
3
+ import { CheckCircleIcon } from '../../icons/index.js';
4
+ import { AlertDialog, Button } from '../../ui/index.js';
5
+ import { useAccountVerificationContext } from './AccountVerificationContext.js';
6
+ export function VerificationComplete() {
7
+ const context = useAccountVerificationContext();
8
+ return (_jsx(AlertDialog.Root, { open: context.completed, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(Button, { className: "mt-3xl", onClick: () => context.reset(), children: "Ok" })] }) })] }) }));
9
+ }
@@ -0,0 +1 @@
1
+ export declare function VerificationDetails(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ark } from '@ark-ui/react';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
5
+ import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
6
+ import { Button } from '../../ui/index.js';
7
+ import { useAccountVerificationContext } from './AccountVerificationContext.js';
8
+ export function VerificationDetails() {
9
+ const context = useAccountVerificationContext();
10
+ const profileCompletionQuery = useProfileCompletionQuery();
11
+ const profileCompletion = profileCompletionQuery.data;
12
+ const verificationQuery = useMemberVerificationQuery();
13
+ const verification = verificationQuery.data;
14
+ const empty = verification == null;
15
+ const pending = verification?.status === 'PENDING';
16
+ const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
17
+ const failed = verification?.status === 'REJECTED' ||
18
+ verification?.status === 'UNVERIFIED';
19
+ if (context.started)
20
+ return null;
21
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
22
+ ? 'text-text-success-primary'
23
+ : 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary flex justify-end border-t px-4 py-3 lg:py-xl", children: _jsx(Button, { size: "sm", onClick: () => {
24
+ context.setStarted(true);
25
+ }, className: "w-full lg:w-fit", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
26
+ }
27
+ function VerificationNotSubmitted() {
28
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 max-w-[800px] text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
29
+ }
30
+ function VerificationInProgress() {
31
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] })] }));
32
+ }
33
+ function VerificationSuccess() {
34
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] })] }));
35
+ }
36
+ function VerificationFailed() {
37
+ return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] })] }));
38
+ }
@@ -0,0 +1,2 @@
1
+ import type { PromoProps } from './Promo';
2
+ export declare function Promo__client(props: PromoProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from 'next/image';
4
+ import Link from 'next/link';
5
+ import { ChevronLeftIcon } from '../../icons/index.js';
6
+ import { Button, Prose } from '../../ui/index.js';
7
+ export function Promo__client(props) {
8
+ return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: "https://s3.ap-east-1.amazonaws.com/opexa-assets.opexasystem.com/assets/BSxIXEsa59_zzMAR27-ALLDAYREBATE06-STATIC-WEB-HB-1920x1080.png", alt: "", width: 1024, height: 600, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx(Button, { className: "mt-xl lg:mt-6", children: "Deposit Now" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: "Welcome Bonus 100% up to $500 + 10 Free Spins" }), _jsx("p", { className: "text-text-secondary-700 mt-xl lg:mt-6", children: "Ends 5/26/2025, 1:59:59 AM" }), _jsxs(Prose, { className: "mt-2xl lg:mt-6", children: [_jsx("p", { children: "Mi tincidunt elit, id quisque ligula ac diam, amet. Vel etiam suspendisse morbi eleifend faucibus eget vestibulum felis. Dictum quis montes, sit sit. Tellus aliquam enim urna, etiam. Mauris posuere vulputate arcu amet, vitae nisi, tellus tincidunt. At feugiat sapien varius id." }), _jsx("p", { children: "Eget quis mi enim, leo lacinia pharetra, semper. Eget in volutpat mollis at volutpat lectus velit, sed auctor. Porttitor fames arcu quis fusce augue enim. Quis at habitant diam at. Suscipit tristique risus, at donec. In turpis vel et quam imperdiet. Ipsum molestie aliquet sodales id est ac volutpat." }), _jsx("p", { children: "Ipsum sit mattis nulla quam nulla. Gravida id gravida ac enim mauris id. Non pellentesque congue eget consectetur turpis. Sapien, dictum molestie sem tempor. Diam elit, orci, tincidunt aenean tempus. Quis velit eget ut tortor tellus. Sed vel, congue felis elit erat nam nibh orci." }), _jsx("p", { children: "Dolor enim eu tortor urna sed duis nulla. Aliquam vestibulum, nulla odio nisl vitae. In aliquet pellentesque aenean hac vestibulum turpis mi bibendum diam. Tempor integer aliquam in vitae malesuada fringilla." }), _jsx("p", { children: "Elit nisi in eleifend sed nisi. Pulvinar at orci, proin imperdiet commodo consectetur convallis risus. Sed condimentum enim dignissim adipiscing faucibus consequat, urna. Viverra purus et erat auctor aliquam. Risus, volutpat vulputate posuere purus sit congue convallis aliquet. Arcu id augue ut feugiat donec porttitor neque. Mauris, neque ultricies eu vestibulum, bibendum quam lorem id. Dolor lacus, eget nunc lectus in tellus, pharetra, porttitor." }), _jsx("p", { children: "Ipsum sit mattis nulla quam nulla. Gravida id gravida ac enim mauris id. Non pellentesque congue eget consectetur turpis. Sapien, dictum molestie sem tempor. Diam elit, orci, tincidunt aenean tempus. Quis velit eget ut tortor tellus. Sed vel, congue felis elit erat nam nibh orci." }), _jsx("h5", { children: "General Conditions:" }), _jsx("p", { children: "Mi tincidunt elit, id quisque ligula ac diam, amet. Vel etiam suspendisse morbi eleifend faucibus eget vestibulum felis. Dictum quis montes, sit sit. Tellus aliquam enim urna, etiam. Mauris posuere vulputate arcu amet, vitae nisi, tellus tincidunt. At feugiat sapien varius id." }), _jsx("p", { children: "Eget quis mi enim, leo lacinia pharetra, semper. Eget in volutpat mollis at volutpat lectus velit, sed auctor. Porttitor fames arcu quis fusce augue enim. Quis at habitant diam at. Suscipit tristique risus, at donec. In turpis vel et quam imperdiet. Ipsum molestie aliquet sodales id est ac volutpat." })] }), _jsxs(Prose, { className: "bg-bg-secondary mt-xl rounded-2xl p-2xl lg:mt-16 lg:p-4xl", children: [_jsx("h2", { children: "Conclusion" }), _jsx("p", { children: "Morbi sed imperdiet in ipsum, adipiscing elit dui lectus. Tellus id scelerisque est ultricies ultricies. Duis est sit sed leo nisl, blandit elit sagittis. Quisque tristique consequat quam sed. Nisl at scelerisque amet nulla purus habitasse." }), _jsx("p", { children: "Nunc sed faucibus bibendum feugiat sed interdum. Ipsum egestas condimentum mi massa. In tincidunt pharetra consectetur sed duis facilisis metus. Etiam egestas in nec sed et. Quis lobortis at sit dictum eget nibh tortor commodo cursus." }), _jsx("p", { children: "Odio felis sagittis, morbi feugiat tortor vitae feugiat fusce aliquet. Nam elementum urna nisi aliquet erat dolor enim. Ornare id morbi eget ipsum. Aliquam senectus neque ut id eget consectetur dictum. Donec posuere pharetra odio consequat scelerisque et, nunc tortor." })] })] }));
9
+ }
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PromoContent } from './PromoContent.js';
2
+ import { Promo__client } from './Promo.client.js';
3
3
  export async function Promo(props) {
4
4
  /**
5
5
  * await prefetchPromoQuery(props.id);
6
6
  */
7
- return _jsx(PromoContent, { id: props.id });
7
+ return _jsx(Promo__client, { ...props });
8
8
  }
@@ -10,8 +10,8 @@ import { Button } from '../../ui/index.js';
10
10
  import { Empty } from '../Empty.js';
11
11
  import { PromosItem } from './PromoItem.js';
12
12
  export function PromoCarousel(props) {
13
- const promosQuery = usePromosQuery({});
14
- const promos = promosQuery.data || [];
13
+ const promosQuery = usePromosQuery();
14
+ const promos = promosQuery.data ?? [];
15
15
  const [emblaRef, emblaApi] = useEmblaCarousel({
16
16
  align: 'start',
17
17
  slidesToScroll: 1,
@@ -37,5 +37,5 @@ export function PromoCarousel(props) {
37
37
  onSelect(emblaApi);
38
38
  emblaApi.on('reInit', onSelect).on('select', onSelect);
39
39
  }, [emblaApi, onSelect]);
40
- return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Promotions' }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/promos', className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), promos.length >= 1 && (_jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[calc((100%-(0.375rem*2))/1)] grid-flow-col gap-sm lg:auto-cols-[calc((100%-(0.5rem*5))/3)] lg:gap-md'), children: promos.map((promo) => (_jsx(PromosItem, { promo: promo, shouldShowDescription: props.shouldShowDescription }, promo.id))) }) }))] }));
40
+ return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Promotions' }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/promos', className: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), promos.length >= 1 && (_jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[100%] grid-flow-col gap-1.5 lg:auto-cols-[calc((100%-(1.25rem*2))/3)] lg:gap-2xl'), children: promos.map((promo) => (_jsx(PromosItem, { promo: promo, redirectUrl: props.viewAllUrl }, promo.id))) }) }))] }));
41
41
  }
@@ -1,12 +1,11 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { twMerge } from 'tailwind-merge';
4
3
  import { usePromosQuery } from '../../client/hooks/index.js';
5
4
  import { Gift01Icon } from '../../icons/index.js';
6
5
  import { Empty } from '../Empty.js';
7
6
  import { PromosItem } from './PromoItem.js';
8
7
  export function PromoGrid(props) {
9
- const promosQuery = usePromosQuery({});
10
- const promos = promosQuery.data || [];
11
- return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-lg" })), promos.length >= 1 && (_jsx("div", { className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid grid-cols-1 gap-sm lg:grid-cols-3 lg:gap-md'), children: promos.map((promo) => (_jsx(PromosItem, { promo: promo, shouldShowDescription: props.shouldShowDescription }, promo.id))) }) }))] }));
8
+ const promosQuery = usePromosQuery();
9
+ const promos = promosQuery.data ?? [];
10
+ return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-lg" })), promos.length >= 1 && (_jsx("div", { className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: "grid gap-3xl lg:grid-cols-3 lg:gap-2xl", children: promos.map((promo) => (_jsx(PromosItem, { promo: promo, redirectUrl: props.viewAllUrl }, promo.id))) }) }))] }));
12
11
  }
@@ -1,7 +1,7 @@
1
1
  import type { Promo } from '@opexa/portal-sdk-core';
2
2
  interface PromosItemProps {
3
3
  promo: Promo;
4
- shouldShowDescription?: boolean;
4
+ redirectUrl?: string;
5
5
  }
6
6
  export declare function PromosItem(props: PromosItemProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
- import { useRouter } from 'next/navigation';
4
- import { twJoin } from 'tailwind-merge';
3
+ import Link from 'next/link';
5
4
  import { Button } from '../../ui/index.js';
6
5
  export function PromosItem(props) {
7
6
  const { promo } = props;
8
- const router = useRouter();
9
- return (_jsxs("div", { className: "border-border-primary bg-accent-50 relative flex h-full flex-col rounded-md border", children: [promo.banner.url && (_jsx(Image, { src: promo.banner.url, alt: promo.name, width: 1200, height: 500, priority: true, className: "aspect-[1200/500] w-full rounded-t-md object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col p-4", children: [_jsx("p", { className: twJoin('w-full text-xl font-bold', props.shouldShowDescription ? 'text-start' : 'text-center'), children: promo.name }), props.shouldShowDescription && promo.description && (_jsx("p", { className: "text-gray-600 mb-2 line-clamp-2 w-full overflow-hidden text-start text-sm", dangerouslySetInnerHTML: { __html: promo.description } })), _jsx("div", { className: "mt-auto pt-4", children: _jsx(Button, { className: "w-full text-sm font-semibold", onClick: () => router.push(`/promos/${promo.id}`), children: "Get Bonus" }) })] })] }, promo.id));
7
+ return (_jsxs(Link, { href: `${props.redirectUrl ?? '/promos'}/${promo.id}`, className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [promo.banner.url && (_jsx(Image, { src: promo.banner.url, alt: promo.name, width: 1200, height: 500, priority: true, className: "block aspect-[365/180] w-full object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: promo.name }), _jsx("div", { className: "mt-auto pt-4", children: _jsx(Button, { size: "sm", asChild: true, children: _jsx("div", { role: "button", onClick: (e) => {
8
+ e.preventDefault();
9
+ e.stopPropagation();
10
+ }, children: "Get bonus" }) }) })] })] }));
10
11
  }
@@ -3,11 +3,9 @@ export interface PromosProps {
3
3
  heading?: string;
4
4
  /** @default "/promos" */
5
5
  viewAllUrl?: string;
6
- /** @default true */
7
- shouldShowDescription?: boolean;
8
6
  /** @default 1 */
9
7
  className?: string;
10
8
  /** @default 'carousel' */
11
9
  layout?: 'carousel' | 'grid';
12
10
  }
13
- export declare function Promos(props: PromosProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Promos(props: PromosProps): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -1,7 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { prefetchPromosQuery } from '../../server/utils/index.js';
2
3
  import { PromoCarousel } from './PromoCarousel.js';
3
4
  import { PromoGrid } from './PromoGrid.js';
4
- export function Promos(props) {
5
+ export async function Promos(props) {
6
+ await prefetchPromosQuery();
5
7
  if (props.layout === 'grid') {
6
8
  return _jsx(PromoGrid, { ...props });
7
9
  }
@@ -0,0 +1,2 @@
1
+ import type { QuestsProps } from './Quests';
2
+ export declare function Quests__client(props: QuestsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from 'next/image';
4
+ import { useAvailableQuestsQuery } from '../../client/hooks/index.js';
5
+ import { SpinnerIcon } from '../../icons/index.js';
6
+ import closeChest from '../../images/close-chest.png';
7
+ import { DailyCheckInQuest } from './DailyCheckInQuest/DailyCheckInQuest.js';
8
+ import { OnboardingQuest } from './OnboardingQuest/OnboardingQuest.js';
9
+ import { WageringQuest } from './WageringQuest/WageringQuest.js';
10
+ const QUEST_COMPONENT_MAP = {
11
+ DAILY_CHECKIN: DailyCheckInQuest,
12
+ ONBOARDING: OnboardingQuest,
13
+ WAGERING: WageringQuest,
14
+ };
15
+ export function Quests__client(props) {
16
+ const query = useAvailableQuestsQuery();
17
+ if (query.isLoading) {
18
+ return (_jsxs("div", { className: props.className, children: [_jsx("h3", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsx(SpinnerIcon, { className: "mx-auto size-5 h-[50vh]" })] }));
19
+ }
20
+ if (!query.data?.length) {
21
+ return (_jsxs("div", { className: props.className, children: [_jsx("h3", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { src: closeChest, width: 100, height: 100, alt: "No Quests Available", className: "mix-blend-luminosity", quality: 100 }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Quests' }), _jsx("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: "No available quests. Please check back later!" })] })] }));
22
+ }
23
+ return (_jsxs("div", { className: props.className, children: [_jsx("h3", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsx("div", { className: "grid grid-cols-1 gap-3xl lg:grid-cols-3", children: query.data.map((quest, index) => {
24
+ const QuestComponent = QUEST_COMPONENT_MAP[quest.type];
25
+ return _jsx(QuestComponent, { quest: quest }, index);
26
+ }) })] }));
27
+ }
@@ -3,4 +3,4 @@ export interface QuestsProps {
3
3
  heading?: string;
4
4
  className?: string;
5
5
  }
6
- export declare function Quests(props: QuestsProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function Quests(props: QuestsProps): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -1,27 +1,7 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import Image from 'next/image';
4
- import { useAvailableQuestsQuery } from '../../client/hooks/index.js';
5
- import { SpinnerIcon } from '../../icons/index.js';
6
- import closeChest from '../../images/close-chest.png';
7
- import { DailyCheckInQuest } from './DailyCheckInQuest/DailyCheckInQuest.js';
8
- import { OnboardingQuest } from './OnboardingQuest/OnboardingQuest.js';
9
- import { WageringQuest } from './WageringQuest/WageringQuest.js';
10
- const QUEST_COMPONENT_MAP = {
11
- DAILY_CHECKIN: DailyCheckInQuest,
12
- ONBOARDING: OnboardingQuest,
13
- WAGERING: WageringQuest,
14
- };
15
- export function Quests(props) {
16
- const query = useAvailableQuestsQuery();
17
- if (query.isLoading) {
18
- return (_jsxs("div", { className: props.className, children: [_jsx("h3", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsx(SpinnerIcon, { className: "mx-auto size-5 h-[50vh]" })] }));
19
- }
20
- if (!query.data?.length) {
21
- return (_jsxs("div", { className: props.className, children: [_jsx("h3", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { src: closeChest, width: 100, height: 100, alt: "No Quests Available", className: "mix-blend-luminosity", quality: 100 }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Quests' }), _jsx("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: "No available quests. Please check back later!" })] })] }));
22
- }
23
- return (_jsxs("div", { className: props.className, children: [_jsx("h3", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsx("div", { className: "grid grid-cols-1 gap-3xl lg:grid-cols-3", children: query.data.map((quest, index) => {
24
- const QuestComponent = QUEST_COMPONENT_MAP[quest.type];
25
- return _jsx(QuestComponent, { quest: quest }, index);
26
- }) })] }));
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { prefetchAvailableQuestsQuery } from '../../server/utils/index.js';
3
+ import { Quests__client } from './Quests.client.js';
4
+ export async function Quests(props) {
5
+ await prefetchAvailableQuestsQuery();
6
+ return _jsx(Quests__client, { ...props });
27
7
  }
@@ -0,0 +1,2 @@
1
+ import type { TournamentsProps } from './Tournaments';
2
+ export declare function Tournaments__client(props: TournamentsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from 'next/image';
4
+ import { useTournamentsQuery } from '../../client/hooks/index.js';
5
+ import closeChest from '../../images/close-chest.png';
6
+ import { TournamentItemDesktop } from './TournamentItemDesktop.js';
7
+ import { TournamentItemMobile } from './TournamentItemMobile.js';
8
+ export function Tournaments__client(props) {
9
+ const tournamentsQuery = useTournamentsQuery({
10
+ first: 100,
11
+ filter: {
12
+ status: {
13
+ equal: 'ACTIVE',
14
+ },
15
+ },
16
+ });
17
+ 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
+ }
@@ -7,4 +7,4 @@ export interface TournamentsProps {
7
7
  className?: string;
8
8
  gameProviders: GameProviderData[];
9
9
  }
10
- export declare function Tournaments(props: TournamentsProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function Tournaments(props: TournamentsProps): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -1,12 +1,8 @@
1
- 'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import Image from 'next/image';
4
- import { useTournamentsQuery } from '../../client/hooks/index.js';
5
- import closeChest from '../../images/close-chest.png';
6
- import { TournamentItemDesktop } from './TournamentItemDesktop.js';
7
- import { TournamentItemMobile } from './TournamentItemMobile.js';
8
- export function Tournaments(props) {
9
- const tournamentsQuery = useTournamentsQuery({
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { prefetchTournamentsQuery } from '../../server/utils/index.js';
3
+ import { Tournaments__client } from './Tournaments.client.js';
4
+ export async function Tournaments(props) {
5
+ await prefetchTournamentsQuery({
10
6
  first: 100,
11
7
  filter: {
12
8
  status: {
@@ -14,6 +10,5 @@ export function Tournaments(props) {
14
10
  },
15
11
  },
16
12
  });
17
- 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!"] })] }))] }));
13
+ return _jsx(Tournaments__client, { ...props });
19
14
  }
@@ -1,5 +1,6 @@
1
1
  export * from './prefetchAccountQuery';
2
2
  export * from './prefetchAvailablePromosQuery';
3
+ export * from './prefetchAvailableQuestsQuery';
3
4
  export * from './prefetchBetRecordsQuery';
4
5
  export * from './prefetchBonusesQuery';
5
6
  export * from './prefetchCashbacksQuery';
@@ -1,5 +1,6 @@
1
1
  export * from './prefetchAccountQuery.js';
2
2
  export * from './prefetchAvailablePromosQuery.js';
3
+ export * from './prefetchAvailableQuestsQuery.js';
3
4
  export * from './prefetchBetRecordsQuery.js';
4
5
  export * from './prefetchBonusesQuery.js';
5
6
  export * from './prefetchCashbacksQuery.js';
@@ -0,0 +1 @@
1
+ export declare const prefetchAvailableQuestsQuery: () => Promise<void>;
@@ -0,0 +1,22 @@
1
+ import { getAvailableQuests } from '@opexa/portal-sdk-core';
2
+ import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
3
+ import { getAvailableQuestsQueryKey, getQueryClient } from '../../utils/index.js';
4
+ import { getSession } from '../services/getSession.js';
5
+ export const prefetchAvailableQuestsQuery = async () => {
6
+ const session = await getSession();
7
+ if (session.status === 'unauthenticated')
8
+ return;
9
+ await getQueryClient().prefetchQuery({
10
+ queryKey: getAvailableQuestsQueryKey(),
11
+ queryFn: async ({ signal }) => {
12
+ return await getAvailableQuests({
13
+ signal,
14
+ environment: ENVIRONMENT,
15
+ headers: {
16
+ 'Platform-Code': PLATFORM_CODE,
17
+ Authorization: `Bearer ${session.token}`,
18
+ },
19
+ });
20
+ },
21
+ });
22
+ };