@tap-payments/os-micro-frontend-shared 0.0.185 → 0.0.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/Button/StyledButton/style.js +1 -1
- package/build/components/CountryFlag/CountryFlag.js +1 -3
- package/build/components/TableCells/CustomCells/ActionCell/ActionCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ActionCell/ActionCell.js +13 -13
- package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.d.ts +1 -3
- package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.js +3 -4
- package/build/components/TableCells/CustomCells/ActionCell/style.js +1 -1
- package/build/components/TableCells/CustomCells/type.d.ts +1 -2
- package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.js +1 -1
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/constants/assets.d.ts +0 -11
- package/build/constants/assets.js +0 -11
- package/build/types/api.d.ts +0 -1
- package/package.json +1 -1
- package/build/components/StatusButtons/StatusButtons.d.ts +0 -11
- package/build/components/StatusButtons/StatusButtons.js +0 -38
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Box from '@mui/material/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const Button = styled(Box)(({ isActive, isDisabled, theme }) => (Object.assign(Object.assign(Object.assign({ minWidth: 32, height: 32, width: 'fit-content', borderRadius: '4px', padding: '9px 8px', display: 'flex', alignItems: 'center', justifyContent: 'center', border: `1px solid ${theme.palette.divider}`, cursor: 'pointer' }, (isActive && {
|
|
3
|
+
export const Button = styled(Box, { shouldForwardProp: (prop) => prop !== 'isActive' && prop !== 'isDisabled' })(({ isActive, isDisabled, theme }) => (Object.assign(Object.assign(Object.assign({ minWidth: 32, height: 32, width: 'fit-content', borderRadius: '4px', padding: '9px 8px', display: 'flex', alignItems: 'center', justifyContent: 'center', border: `1px solid ${theme.palette.divider}`, cursor: 'pointer' }, (isActive && {
|
|
4
4
|
boxShadow: theme.shadows[7],
|
|
5
5
|
borderColor: theme.palette.info.dark,
|
|
6
6
|
})), (isDisabled && {
|
|
@@ -15,8 +15,6 @@ import Box from '@mui/material/Box';
|
|
|
15
15
|
import { defaultCountryIcon, getCountriesIcon } from '../../constants/index.js';
|
|
16
16
|
function CountryFlag(_a) {
|
|
17
17
|
var { code = '' } = _a, props = __rest(_a, ["code"]);
|
|
18
|
-
return (_jsx(Box, Object.assign({}, props, { component: "img", src: getCountriesIcon(code) || defaultCountryIcon, alt: code, sx: Object.assign(Object.assign({ width: 16 }, (code && { height: 12, borderRadius: '3px' })), props.sx), loading: "lazy"
|
|
19
|
-
e.currentTarget.src = defaultCountryIcon;
|
|
20
|
-
} })));
|
|
18
|
+
return (_jsx(Box, Object.assign({}, props, { component: "img", src: getCountriesIcon(code) || defaultCountryIcon, alt: code, sx: Object.assign(Object.assign({ width: 16 }, (code && { height: 12, borderRadius: '3px' })), props.sx), loading: "lazy" })));
|
|
21
19
|
}
|
|
22
20
|
export default memo(CountryFlag);
|
|
@@ -5,6 +5,6 @@ type Props = Readonly<ActionCellProps> & {
|
|
|
5
5
|
onJsonViewClick?: () => void;
|
|
6
6
|
tableMode?: TableMode;
|
|
7
7
|
};
|
|
8
|
-
declare function ActionCell({ flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown, row, showJsonViewer, isTextShown, showIdButton, rowId, onJsonViewClick, tableMode,
|
|
8
|
+
declare function ActionCell({ flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown, row, showJsonViewer, isTextShown, showIdButton, rowId, onJsonViewClick, tableMode, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare const _default: React.MemoExoticComponent<typeof ActionCell>;
|
|
10
10
|
export default _default;
|
|
@@ -27,9 +27,9 @@ import { BadgeWrapper, IdButtonContainer, TextLabel, TransparentButton } from '.
|
|
|
27
27
|
import SheetViewIDButton from '../SheetViewIDButton/SheetViewIDButton';
|
|
28
28
|
function ActionCell(_a) {
|
|
29
29
|
var _b, _c;
|
|
30
|
-
var { flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown = true, row, showJsonViewer = true, isTextShown, showIdButton = true, rowId, onJsonViewClick, tableMode
|
|
30
|
+
var { flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown = true, row, showJsonViewer = true, isTextShown, showIdButton = true, rowId, onJsonViewClick, tableMode } = _a, props = __rest(_a, ["flag", "actions", "flagTooltip", "flagsCount", "dropdownAction", "onCloseDropdown", "isDropdownShown", "row", "showJsonViewer", "isTextShown", "showIdButton", "rowId", "onJsonViewClick", "tableMode"]);
|
|
31
31
|
const { t } = useTranslation();
|
|
32
|
-
const { open, anchorEl, filteredActions, isAnyActionLoading, isAnyActionHasError, isAnyActionSuccessful, areThereAnyShownActions, handleClick, handleClose,
|
|
32
|
+
const { open, anchorEl, filteredActions, isAnyActionLoading, isAnyActionHasError, isAnyActionSuccessful, areThereAnyShownActions, handleClick, handleClose, } = useActionCell({ actions, isDropdownShown, onCloseDropdown });
|
|
33
33
|
return (_jsx(TableCell, Object.assign({}, props, { sx: {
|
|
34
34
|
overflow: 'visible',
|
|
35
35
|
} }, { children: _jsxs(ActionCellContainer, Object.assign({ "data-testid": "ActionCell_ActionCellContainer", tableMode: tableMode }, { children: [flag && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "ActionCell_FlagLabel", sx: {
|
|
@@ -81,16 +81,16 @@ function ActionCell(_a) {
|
|
|
81
81
|
pointerEvents: 'none',
|
|
82
82
|
})) }, { children: [_jsx(TransparentButton, Object.assign({ onClick: handleClick, "data-testid": "ActionCell_ActionsIconContainer_TransparentButton", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
|
|
83
83
|
pointerEvents: 'none',
|
|
84
|
-
})) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
})) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })), dropdownAction, areThereAnyShownActions && (_jsx(Dropdown, { style: { zIndex: 2000 }, open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: filteredActions.map((action) => (Object.assign(Object.assign({}, action), { onClick: (e) => {
|
|
85
|
+
var _a;
|
|
86
|
+
(_a = action === null || action === void 0 ? void 0 : action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
|
|
87
|
+
if (!action.hasActionMenu) {
|
|
88
|
+
handleClose();
|
|
89
|
+
}
|
|
90
|
+
}, onRightClick: (e) => {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = action === null || action === void 0 ? void 0 : action.onRightClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
|
|
93
|
+
handleClose();
|
|
94
|
+
}, icon: (_jsx(ActionIcon, { icon: action.icon, src: actionIcons[action.icon], initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, `action.label-${action.label.trim()}`)) }))) }))] }))] }))] })) })));
|
|
95
95
|
}
|
|
96
96
|
export default memo(ActionCell);
|
|
@@ -4,9 +4,8 @@ interface UseActionCellProps {
|
|
|
4
4
|
actions: ActionCellProps['actions'];
|
|
5
5
|
isDropdownShown?: ActionCellProps['isDropdownShown'];
|
|
6
6
|
onCloseDropdown?: ActionCellProps['onCloseDropdown'];
|
|
7
|
-
renderDropdown?: ActionCellProps['renderDropdown'];
|
|
8
7
|
}
|
|
9
|
-
export declare function useActionCell({ actions, isDropdownShown, onCloseDropdown
|
|
8
|
+
export declare function useActionCell({ actions, isDropdownShown, onCloseDropdown }: Readonly<UseActionCellProps>): {
|
|
10
9
|
anchorEl: HTMLElement | null;
|
|
11
10
|
open: boolean;
|
|
12
11
|
filteredActions: {
|
|
@@ -26,6 +25,5 @@ export declare function useActionCell({ actions, isDropdownShown, onCloseDropdow
|
|
|
26
25
|
areThereAnyShownActions: boolean;
|
|
27
26
|
handleClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
28
27
|
handleClose: () => void;
|
|
29
|
-
setAnchorEl: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
|
|
30
28
|
};
|
|
31
29
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
export function useActionCell({ actions, isDropdownShown, onCloseDropdown
|
|
2
|
+
export function useActionCell({ actions, isDropdownShown, onCloseDropdown }) {
|
|
3
3
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
4
4
|
const open = Boolean(anchorEl);
|
|
5
|
-
const filteredActions =
|
|
5
|
+
const filteredActions = actions.filter((a) => a.isShown !== false);
|
|
6
6
|
const isAnyActionLoading = filteredActions.some((a) => a.isLoading);
|
|
7
7
|
const isAnyActionHasError = filteredActions.some((a) => a.isError);
|
|
8
8
|
const isAnyActionSuccessful = filteredActions.some((a) => a.isSuccess);
|
|
9
|
-
const areThereAnyShownActions = filteredActions.length > 0
|
|
9
|
+
const areThereAnyShownActions = filteredActions.length > 0;
|
|
10
10
|
const handleClick = (event) => {
|
|
11
11
|
if (isAnyActionLoading || !areThereAnyShownActions) {
|
|
12
12
|
return;
|
|
@@ -32,6 +32,5 @@ export function useActionCell({ actions, isDropdownShown, onCloseDropdown, rende
|
|
|
32
32
|
areThereAnyShownActions,
|
|
33
33
|
handleClick,
|
|
34
34
|
handleClose,
|
|
35
|
-
setAnchorEl,
|
|
36
35
|
};
|
|
37
36
|
}
|
|
@@ -11,7 +11,7 @@ export const ActionCellContainer = styled('section', {
|
|
|
11
11
|
gap: tableMode === 'sheet' ? '4px' : theme.spacing(1),
|
|
12
12
|
overflow: 'visible',
|
|
13
13
|
}));
|
|
14
|
-
export const ActionsIconContainer = styled('span')(({ selected }) => (Object.assign(Object.assign({ overflow: 'visible', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center',
|
|
14
|
+
export const ActionsIconContainer = styled('span')(({ selected }) => (Object.assign(Object.assign({ overflow: 'visible', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', '&:hover': {
|
|
15
15
|
boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.18);',
|
|
16
16
|
} }, (selected && {
|
|
17
17
|
boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.18);',
|
|
@@ -89,7 +89,7 @@ export interface DestinationCellProps extends TableCellProps {
|
|
|
89
89
|
export interface ActionCellProps extends TableCellProps {
|
|
90
90
|
row?: unknown;
|
|
91
91
|
flag?: FlagType;
|
|
92
|
-
actions
|
|
92
|
+
actions: Array<{
|
|
93
93
|
label: string;
|
|
94
94
|
onClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
95
95
|
onRightClick?: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
@@ -109,7 +109,6 @@ export interface ActionCellProps extends TableCellProps {
|
|
|
109
109
|
showJsonViewer?: boolean;
|
|
110
110
|
isTextShown?: boolean;
|
|
111
111
|
showIdButton?: boolean;
|
|
112
|
-
renderDropdown?: (anchorEl: HTMLElement | null, setAnchorEl: (anchorEl: HTMLElement | null) => void) => React.ReactNode;
|
|
113
112
|
}
|
|
114
113
|
export interface DeviceCellProps extends TableCellProps {
|
|
115
114
|
deviceType?: 'DESKTOP' | 'PHONE' | 'TABLET';
|
|
@@ -52,7 +52,7 @@ function ColumnFilter(filter) {
|
|
|
52
52
|
}, [open, filter, anchorEl, setAnchorEl]);
|
|
53
53
|
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCloseDropdown }, { children: _jsxs(Box, Object.assign({ component: "section", "data-testid": "ColumnFilter", sx: { position: 'relative', display: 'flex', alignItems: 'center' } }, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 }, onClick: openDropdown }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: () => {
|
|
54
54
|
filter.onClear(filterApiKeys);
|
|
55
|
-
} })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: {
|
|
55
|
+
} })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { marginInlineStart: '8px', cursor: 'pointer' }, onClick: openDropdown })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start", sx: {
|
|
56
56
|
zIndex: 9999,
|
|
57
57
|
} }, { children: renderFilter }))] })) })));
|
|
58
58
|
}
|
|
@@ -12,7 +12,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
12
12
|
export { default as Dialog, DialogToolbar } from './Dialog';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
|
14
14
|
export * from './RFH';
|
|
15
|
-
export { default as VirtualTable, TableRowLoading, TableHeader
|
|
15
|
+
export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
16
16
|
export { default as SheetViewVirtualTable } from './VirtualTable/SheetView/SheetViewVirtualTable';
|
|
17
17
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
18
18
|
export { default as TapLogo } from './TapLogo';
|
|
@@ -12,7 +12,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
12
12
|
export { default as Dialog, DialogToolbar } from './Dialog';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
|
14
14
|
export * from './RFH';
|
|
15
|
-
export { default as VirtualTable, TableRowLoading, TableHeader
|
|
15
|
+
export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
16
16
|
export { default as SheetViewVirtualTable } from './VirtualTable/SheetView/SheetViewVirtualTable';
|
|
17
17
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
18
18
|
export { default as TapLogo } from './TapLogo';
|
|
@@ -493,14 +493,3 @@ export declare const navigationPointerBlack: string;
|
|
|
493
493
|
export declare const addIconWhite: string;
|
|
494
494
|
export declare const greyUpArrowIcon: string;
|
|
495
495
|
export declare const greyDownArrowIcon: string;
|
|
496
|
-
export declare const brandServiceIcon: string;
|
|
497
|
-
export declare const authorizationServiceIcon: string;
|
|
498
|
-
export declare const chargebacksServiceIcon: string;
|
|
499
|
-
export declare const chargesServiceIcon: string;
|
|
500
|
-
export declare const destinationsServiceIcon: string;
|
|
501
|
-
export declare const entityServiceIcon: string;
|
|
502
|
-
export declare const invoiceServiceIcon: string;
|
|
503
|
-
export declare const payoutServiceIcon: string;
|
|
504
|
-
export declare const refundsServiceIcon: string;
|
|
505
|
-
export declare const usersServiceIcon: string;
|
|
506
|
-
export declare const walletServiceIcon: string;
|
|
@@ -497,14 +497,3 @@ export const navigationPointerBlack = `${lightUrl}/navigationPointerBlack.svg`;
|
|
|
497
497
|
export const addIconWhite = `${lightUrl}/addIconWhite.svg`;
|
|
498
498
|
export const greyUpArrowIcon = `${lightUrl}/greyUpArrow.svg`;
|
|
499
499
|
export const greyDownArrowIcon = `${lightUrl}/greyDownArrow.svg`;
|
|
500
|
-
export const brandServiceIcon = `${lightUrl}/services/brandService.svg`;
|
|
501
|
-
export const authorizationServiceIcon = `${lightUrl}/services/authorizationService.svg`;
|
|
502
|
-
export const chargebacksServiceIcon = `${lightUrl}/services/chargebacksService.svg`;
|
|
503
|
-
export const chargesServiceIcon = `${lightUrl}/services/chargesService.svg`;
|
|
504
|
-
export const destinationsServiceIcon = `${lightUrl}/services/destinationsService.svg`;
|
|
505
|
-
export const entityServiceIcon = `${lightUrl}/services/entityService.svg`;
|
|
506
|
-
export const invoiceServiceIcon = `${lightUrl}/services/invoiceService.svg`;
|
|
507
|
-
export const payoutServiceIcon = `${lightUrl}/services/payoutService.svg`;
|
|
508
|
-
export const refundsServiceIcon = `${lightUrl}/services/refundsService.svg`;
|
|
509
|
-
export const usersServiceIcon = `${lightUrl}/services/usersService.svg`;
|
|
510
|
-
export const walletServiceIcon = `${lightUrl}/services/walletService.svg`;
|
package/build/types/api.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { AvailableStatus } from '../StatusBar/type';
|
|
3
|
-
import { TableHeaderStatus } from '../../types/index.js';
|
|
4
|
-
export type StatusButtonsProps = {
|
|
5
|
-
availableStatuses: AvailableStatus[];
|
|
6
|
-
status: TableHeaderStatus;
|
|
7
|
-
onStatusChange?: (status: TableHeaderStatus) => void;
|
|
8
|
-
isFilteredIdsShown?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: import("react").MemoExoticComponent<(props: StatusButtonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
-
export default _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createElement as _createElement } from "react";
|
|
3
|
-
import StatusButton from '../StatusButton/StatusButton';
|
|
4
|
-
import { memo, useMemo } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
const StatusButtonItem = memo((props) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const { availableStatus, getButtonStatus, onStatusChange, status } = props;
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
if (!Array.isArray(availableStatus.status)) {
|
|
11
|
-
return (_createElement(StatusButton, Object.assign({}, availableStatus, { key: `status-button-array-${availableStatus.status}`, variant: getButtonStatus(availableStatus.status), onClick: () => {
|
|
12
|
-
if (!Array.isArray(availableStatus.status)) {
|
|
13
|
-
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(availableStatus.status);
|
|
14
|
-
}
|
|
15
|
-
} })));
|
|
16
|
-
}
|
|
17
|
-
const isCurrentStatusDropdown = (_a = availableStatus.status) === null || _a === void 0 ? void 0 : _a.includes(status || '');
|
|
18
|
-
const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
|
|
19
|
-
const statusLabel = isCurrentStatusDropdown ? status : availableStatus.status[0];
|
|
20
|
-
return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, availableStatus, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
|
|
21
|
-
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(buttonStatus);
|
|
22
|
-
}, dropdownOptions: availableStatus.status.map((stat) => ({
|
|
23
|
-
label: t(stat || ''),
|
|
24
|
-
onClick: () => {
|
|
25
|
-
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(stat);
|
|
26
|
-
},
|
|
27
|
-
status: stat,
|
|
28
|
-
})) })) }));
|
|
29
|
-
});
|
|
30
|
-
const StatusButtons = (props) => {
|
|
31
|
-
const { availableStatuses, status, onStatusChange, isFilteredIdsShown } = props;
|
|
32
|
-
const getButtonStatus = useMemo(() => (buttonStatus) => buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive', [status, isFilteredIdsShown]);
|
|
33
|
-
return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((availableStatus) => {
|
|
34
|
-
var _a;
|
|
35
|
-
return (_jsx(StatusButtonItem, { availableStatus: availableStatus, getButtonStatus: getButtonStatus, onStatusChange: onStatusChange, status: status }, Array.isArray(availableStatus.status) ? (_a = availableStatus === null || availableStatus === void 0 ? void 0 : availableStatus.status) === null || _a === void 0 ? void 0 : _a[0] : `status-button-array-${availableStatus.status}`));
|
|
36
|
-
}) }));
|
|
37
|
-
};
|
|
38
|
-
export default memo(StatusButtons);
|