@opexa/portal-components 0.0.738 → 0.0.739
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.
|
@@ -11,6 +11,7 @@ import { z } from 'zod';
|
|
|
11
11
|
import { useBetRecordsQuery } from '../../client/hooks/useBetRecordsQuery.js';
|
|
12
12
|
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
13
13
|
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
14
|
+
import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
|
|
14
15
|
import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
|
|
15
16
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
16
17
|
import { GAME_PROVIDER_DATA, GAME_TYPE_DATA, GAME_TYPES, } from '../../constants/index.js';
|
|
@@ -31,9 +32,18 @@ import { capitalize } from '../../utils/capitalize.js';
|
|
|
31
32
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
32
33
|
import { Empty } from '../shared/Empty.js';
|
|
33
34
|
export function BetRecords__client(props) {
|
|
35
|
+
const { enabled } = useFeatureFlag();
|
|
34
36
|
const [tab, setTab] = useState('all');
|
|
35
37
|
const gameTypes = props.gameTypes.map((type) => GAME_TYPE_DATA[type]);
|
|
36
|
-
const gameProviders =
|
|
38
|
+
const gameProviders = enabled
|
|
39
|
+
? [
|
|
40
|
+
...props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]),
|
|
41
|
+
...(props.futureGameProviders?.map((provider) => GAME_PROVIDER_DATA[provider]) ?? []),
|
|
42
|
+
]
|
|
43
|
+
: props.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
|
|
44
|
+
// const gameProviders = props.gameProviders.map(
|
|
45
|
+
// (provider) => GAME_PROVIDER_DATA[provider],
|
|
46
|
+
// );
|
|
37
47
|
const [state, setState] = useReducer((prev, next) => ({
|
|
38
48
|
...prev,
|
|
39
49
|
...next,
|
|
@@ -127,8 +137,11 @@ export function BetRecords__client(props) {
|
|
|
127
137
|
}, onValueChange: (timestamp) => {
|
|
128
138
|
setState({ timestamp });
|
|
129
139
|
}, open: disclosure.open, onOpenChange: disclosure.setOpen }), _jsx("div", { className: "hidden grow lg:block" }), _jsxs(Select.Root, { collection: providerCollection, value: state.provider ? [state.provider] : [], onValueChange: (details) => {
|
|
140
|
+
const allProviders = enabled
|
|
141
|
+
? [...props.gameProviders, ...(props.futureGameProviders ?? [])]
|
|
142
|
+
: props.gameProviders;
|
|
130
143
|
const value = z
|
|
131
|
-
.enum((
|
|
144
|
+
.enum((allProviders ?? []))
|
|
132
145
|
.safeParse(details.value.at(0)).data;
|
|
133
146
|
firstPage();
|
|
134
147
|
setState({
|