@pautena/react-design-system 0.1.3 → 0.2.1
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/README.md +4 -0
- package/dist/cjs/index.js +4 -259
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/generators/model-router/index.d.ts +1 -0
- package/dist/cjs/types/generators/model-router/screens/add-screen.d.ts +1 -1
- package/dist/cjs/types/generators/model-router/screens/list-screen.d.ts +1 -1
- package/dist/cjs/types/generators/model-router/screens/screens.types.d.ts +20 -0
- package/dist/cjs/types/generators/model-router/screens/update-screen.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/esm/index.js +4 -259
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/generators/model-router/index.d.ts +1 -0
- package/dist/esm/types/generators/model-router/screens/add-screen.d.ts +1 -1
- package/dist/esm/types/generators/model-router/screens/list-screen.d.ts +1 -1
- package/dist/esm/types/generators/model-router/screens/screens.types.d.ts +20 -0
- package/dist/esm/types/generators/model-router/screens/update-screen.d.ts +1 -1
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/index.d.ts +54 -3
- package/package.json +13 -2
- package/src/components/drawer/mini-drawer/mini-drawer.stories.tsx +2 -2
- package/src/components/drawer-content/drawer-content.stories.tsx +2 -2
- package/src/components/drawer-item/drawer-item.stories.tsx +2 -2
- package/src/components/drawer-section/drawer-section.stories.tsx +2 -2
- package/src/components/header/header.stories.tsx +2 -2
- package/src/components/header/header.test.tsx +2 -12
- package/src/components/tab/tab-card/tab-card.tsx +2 -2
- package/src/components/table-list/table-list.test.tsx +8 -1
- package/src/components/table-list/table-list.tsx +3 -3
- package/src/generators/model-router/index.ts +1 -0
- package/src/generators/model-router/model-router.test.tsx +220 -7
- package/src/generators/model-router/model-router.tsx +4 -3
- package/src/generators/model-router/screens/add-screen.tsx +2 -1
- package/src/generators/model-router/screens/list-screen.tsx +41 -26
- package/src/generators/model-router/screens/screens.types.ts +25 -0
- package/src/generators/model-router/screens/update-screen.tsx +2 -1
- package/src/generators/model-router/stories/list-screen.stories.tsx +51 -0
- package/src/generators/model-router/stories/model-router.stories.tsx +60 -1
- package/src/index.ts +1 -0
- package/src/layouts/app-bar-with-drawer-layout/app-bar-with-drawer-layout.stories.tsx +3 -3
- package/src/layouts/app-bar-with-drawer-layout/app-bar-with-drawer-layout.tsx +1 -1
- package/src/layouts/header-layout/header-layout.stories.tsx +2 -2
|
@@ -13,4 +13,4 @@ export interface AddScreenProps<T extends BasicModelInstance> extends BaseScreen
|
|
|
13
13
|
*/
|
|
14
14
|
newItemRequest: RequestState;
|
|
15
15
|
}
|
|
16
|
-
export declare const AddScreen: <T extends BasicModelInstance>({ model, modelName, onSubmitNewItem, newItemRequest, }: AddScreenProps<T>) => JSX.Element;
|
|
16
|
+
export declare const AddScreen: <T extends BasicModelInstance>({ model, modelName, basePath, onSubmitNewItem, newItemRequest, }: AddScreenProps<T>) => JSX.Element;
|
|
@@ -27,4 +27,4 @@ export interface ListScreenProps<T extends BasicModelInstance> extends BaseScree
|
|
|
27
27
|
*/
|
|
28
28
|
deleteRequest: RequestState;
|
|
29
29
|
}
|
|
30
|
-
export declare const ListScreen: <T extends BasicModelInstance>({ model, modelName, listData,
|
|
30
|
+
export declare const ListScreen: <T extends BasicModelInstance>({ model, modelName, listData, listRequest, deleteRequest, basePath, deleteFeature, updateFeature, addFeature, detailsFeature, onRequestList, onClickDeleteItem, }: ListScreenProps<T>) => JSX.Element;
|
|
@@ -8,4 +8,24 @@ export interface BaseScreenProps {
|
|
|
8
8
|
* Structure that represents the fields of the model
|
|
9
9
|
*/
|
|
10
10
|
model: Model;
|
|
11
|
+
/**
|
|
12
|
+
* Path to attach before each internal ModelRouter path
|
|
13
|
+
*/
|
|
14
|
+
basePath?: string;
|
|
15
|
+
/**
|
|
16
|
+
* If true delete features are enabled
|
|
17
|
+
*/
|
|
18
|
+
deleteFeature?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true update features are enabled
|
|
21
|
+
*/
|
|
22
|
+
updateFeature?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If true add features are enabled
|
|
25
|
+
*/
|
|
26
|
+
addFeature?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* If true details features are enabled
|
|
29
|
+
*/
|
|
30
|
+
detailsFeature?: boolean;
|
|
11
31
|
}
|
|
@@ -26,4 +26,4 @@ export interface UpdateScreenProps<T extends BasicModelInstance> extends BaseScr
|
|
|
26
26
|
*/
|
|
27
27
|
updateItem?: T;
|
|
28
28
|
}
|
|
29
|
-
export declare const UpdateScreen: <T extends BasicModelInstance>({ model, modelName, submitUpdateItemRequest, updateItemRequest, updateItem, onSubmitUpdateItem, onRequestUpdateItem, }: UpdateScreenProps<T>) => JSX.Element;
|
|
29
|
+
export declare const UpdateScreen: <T extends BasicModelInstance>({ model, modelName, basePath, submitUpdateItemRequest, updateItemRequest, updateItem, onSubmitUpdateItem, onRequestUpdateItem, }: UpdateScreenProps<T>) => JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as _mui_material from '@mui/material';
|
|
3
|
-
import { PropTypes, LinkProps as LinkProps$1, AppBarProps as AppBarProps$1, DrawerProps as DrawerProps$1, SxProps, Theme, GridProps, Color } from '@mui/material';
|
|
3
|
+
import { PropTypes, LinkProps as LinkProps$1, AppBarProps as AppBarProps$1, DrawerProps as DrawerProps$1, SxProps, Theme, GridProps, Color, AlertColor } from '@mui/material';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import React__default, { FunctionComponent, ReactElement, PropsWithChildren, ReactNode } from 'react';
|
|
5
|
+
import React__default, { FunctionComponent, ReactElement, PropsWithChildren, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
6
6
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
7
7
|
import { LinkProps } from 'react-router-dom';
|
|
8
8
|
import * as _emotion_styled from '@emotion/styled';
|
|
@@ -509,6 +509,8 @@ interface RequestState {
|
|
|
509
509
|
error?: string;
|
|
510
510
|
success?: boolean;
|
|
511
511
|
}
|
|
512
|
+
declare const IdleRequest: RequestState;
|
|
513
|
+
declare const LoadingRequest: RequestState;
|
|
512
514
|
|
|
513
515
|
interface BaseScreenProps {
|
|
514
516
|
/**
|
|
@@ -519,6 +521,26 @@ interface BaseScreenProps {
|
|
|
519
521
|
* Structure that represents the fields of the model
|
|
520
522
|
*/
|
|
521
523
|
model: Model;
|
|
524
|
+
/**
|
|
525
|
+
* Path to attach before each internal ModelRouter path
|
|
526
|
+
*/
|
|
527
|
+
basePath?: string;
|
|
528
|
+
/**
|
|
529
|
+
* If true delete features are enabled
|
|
530
|
+
*/
|
|
531
|
+
deleteFeature?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* If true update features are enabled
|
|
534
|
+
*/
|
|
535
|
+
updateFeature?: boolean;
|
|
536
|
+
/**
|
|
537
|
+
* If true add features are enabled
|
|
538
|
+
*/
|
|
539
|
+
addFeature?: boolean;
|
|
540
|
+
/**
|
|
541
|
+
* If true details features are enabled
|
|
542
|
+
*/
|
|
543
|
+
detailsFeature?: boolean;
|
|
522
544
|
}
|
|
523
545
|
|
|
524
546
|
interface UpdateScreenProps<T extends BasicModelInstance$1> extends BaseScreenProps {
|
|
@@ -615,4 +637,33 @@ interface ModelFormProps<T extends BasicModelInstance> {
|
|
|
615
637
|
}
|
|
616
638
|
declare const ModelForm: <T extends BasicModelInstance>({ model, saveButtonText, onSubmit, initialValues, }: ModelFormProps<T>) => JSX.Element;
|
|
617
639
|
|
|
618
|
-
|
|
640
|
+
declare type NotificationCenterProviderProps = PropsWithChildren<{
|
|
641
|
+
autoHideDuration?: number;
|
|
642
|
+
}>;
|
|
643
|
+
declare const NotificationCenterProvider: ({ children, autoHideDuration, }: NotificationCenterProviderProps) => JSX.Element;
|
|
644
|
+
|
|
645
|
+
declare const NotificationCenterProviderUndefinedError: Error;
|
|
646
|
+
declare type SnackbarContentType = React__default.ReactElement<any, any> | ((key: string) => React__default.ReactElement<any, any>);
|
|
647
|
+
declare type SnackbarActionType = React__default.ReactNode | ((key: string) => React__default.ReactNode);
|
|
648
|
+
interface Notification {
|
|
649
|
+
severity: AlertColor;
|
|
650
|
+
title?: string;
|
|
651
|
+
message: string;
|
|
652
|
+
}
|
|
653
|
+
interface NotificationCenterProps {
|
|
654
|
+
show(notification: Notification): void;
|
|
655
|
+
hide(): void;
|
|
656
|
+
}
|
|
657
|
+
declare const NotificationCenterContext: React__default.Context<NotificationCenterProps | undefined>;
|
|
658
|
+
declare const useNotificationCenter: () => NotificationCenterProps;
|
|
659
|
+
|
|
660
|
+
declare const TabContext: React.Context<[number, Dispatch<SetStateAction<number>>]>;
|
|
661
|
+
declare const TabContextProvider: React.Provider<[number, Dispatch<SetStateAction<number>>]>;
|
|
662
|
+
declare const useTab: () => [number, Dispatch<SetStateAction<number>>];
|
|
663
|
+
|
|
664
|
+
declare type TabProviderProps = PropsWithChildren<{
|
|
665
|
+
initialValue?: number;
|
|
666
|
+
}>;
|
|
667
|
+
declare const TabProvider: ({ children, initialValue }: TabProviderProps) => JSX.Element;
|
|
668
|
+
|
|
669
|
+
export { AppBarComponent, AppBarElement, AppBarProfile, AppBarProps, AppBarWithDrawerLayout, AppBarWithDrawerLayoutProps, BasicModelInstance, Bullet, BulletProps, BulletVariant, CenterContainer, CenterContainerProps, Content, ContentComponent, ContentElement, ContentProps, Drawer, DrawerComponent, DrawerContent, DrawerContentComponent, DrawerContentElement, DrawerContentProps, DrawerContext, DrawerContextProps, DrawerElement, DrawerItem, DrawerItemProps, DrawerProps, DrawerProvider, DrawerSection, DrawerSectionProps, EnhancedRemoteTable, EnhancedTable, EnhancedTableHead, GroupField, GroupValueCard, GroupValueCardProps, GroupValueItem, GroupValueItemComponent, GroupValueItemElement, GroupValueItemProps, HeadCell, Header, HeaderAction, HeaderActionVariant, HeaderBreadcrumb, HeaderComponent, HeaderElement, HeaderLayout, HeaderPreset, HeaderProps, HeaderTab, IdleRequest, Label, LabelProps, LabelVariant, Link, LinkBehaviour, LoadingRequest, MiniAppBar, MiniDrawer, Model, ModelField, ModelForm, ModelFormProps, ModelRouter, ModelRouterProps, Nav, NavItem, NavItemAvatar, NavItemBullet, NavItemLabel, NavSection, Notification, NotificationCenterContext, NotificationCenterProps, NotificationCenterProvider, NotificationCenterProviderProps, NotificationCenterProviderUndefinedError, ObjectDetails, ObjectDetailsProps, Order, Placeholder, PlaceholderAction, PlaceholderIconArgs, PlaceholderProps, QueryContainer, QueryContainerError, QueryContainerProps, QueryContainerSuccess, RequestState, SignIn, SnackbarActionType, SnackbarContentType, TabCard, TabContext, TabContextProvider, TabPanel, TabProvider, TableList, TableListProps, TableRowOption, UndefinedProvider, ValueBoolean, ValueBooleanProps, ValueCard, ValueCardProps, ValueText, ValueTextProps, bulletClasses, getRandomItem, groupValueItemClasses, labelClasses, newArrayWithSize, useDrawer, useGetDefaultThemeColor, useNotificationCenter, useTab };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pautena/react-design-system",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "My custom design system on top of MUI",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -86,10 +86,21 @@
|
|
|
86
86
|
"rollup-plugin-dts": "^4.2.2",
|
|
87
87
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
88
88
|
"rollup-plugin-terser": "^7.0.2",
|
|
89
|
-
"storybook-addon-react-router-v6": "^0.1.10",
|
|
90
89
|
"tslib": "^2.4.0",
|
|
91
90
|
"typescript": "^4.7.4"
|
|
92
91
|
},
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"@emotion/react": "^11.5.0",
|
|
94
|
+
"@emotion/styled": "^11.3.0",
|
|
95
|
+
"@mui/icons-material": "^5.0.0",
|
|
96
|
+
"@mui/lab": "^5.0.0",
|
|
97
|
+
"@mui/material": "^5.0.0",
|
|
98
|
+
"@mui/x-data-grid": "^5.13.0",
|
|
99
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
100
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
101
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
102
|
+
"react-router-dom": "^6.0.0"
|
|
103
|
+
},
|
|
93
104
|
"repository": {
|
|
94
105
|
"type": "git",
|
|
95
106
|
"url": "git+https://github.com/pautena/react-design-system.git"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ComponentMeta } from "@storybook/react";
|
|
3
|
-
import { withRouter } from "storybook-addon-react-router-v6";
|
|
4
3
|
import { MiniDrawer } from "../mini-drawer";
|
|
5
4
|
import { mockNav } from "../drawer.mock";
|
|
6
5
|
import { DrawerContent } from "../../drawer-content";
|
|
7
6
|
import { DrawerProvider } from "../drawer.provider";
|
|
8
7
|
import { Nav } from "../drawer.types";
|
|
8
|
+
import { withMemoryRouter } from "../../../storybook";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: "Drawers/MiniDrawer",
|
|
12
12
|
component: MiniDrawer,
|
|
13
|
-
decorators: [
|
|
13
|
+
decorators: [withMemoryRouter()],
|
|
14
14
|
parameters: {
|
|
15
15
|
layout: "fullscreen",
|
|
16
16
|
},
|
|
@@ -4,13 +4,13 @@ import { createTemplate } from "../../storybook";
|
|
|
4
4
|
import { DrawerContent } from "./drawer-content";
|
|
5
5
|
import { mockNav } from "../drawer/drawer.mock";
|
|
6
6
|
import { Box } from "@mui/material";
|
|
7
|
-
import {
|
|
7
|
+
import { withMemoryRouter } from "~/storybook";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Drawers/DrawerContent",
|
|
11
11
|
component: DrawerContent,
|
|
12
12
|
decorators: [
|
|
13
|
-
|
|
13
|
+
withMemoryRouter(),
|
|
14
14
|
(Story) => {
|
|
15
15
|
return <Box maxWidth={300}>{<Story />}</Box>;
|
|
16
16
|
},
|
|
@@ -4,12 +4,12 @@ import { createTemplate } from "../../storybook";
|
|
|
4
4
|
import { DrawerItem } from "./drawer-item";
|
|
5
5
|
import DiamondIcon from "@mui/icons-material/Diamond";
|
|
6
6
|
import { withContainer } from "../../storybook";
|
|
7
|
-
import {
|
|
7
|
+
import { withMemoryRouter } from "~/storybook";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: "Drawers/DrawerItem",
|
|
11
11
|
component: DrawerItem,
|
|
12
|
-
decorators: [
|
|
12
|
+
decorators: [withMemoryRouter(), withContainer({ width: 250 })],
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: "centered",
|
|
15
15
|
},
|
|
@@ -2,13 +2,13 @@ import { ComponentMeta } from "@storybook/react";
|
|
|
2
2
|
import { createTemplate } from "../../storybook";
|
|
3
3
|
import { DrawerSection } from "./drawer-section";
|
|
4
4
|
import { withContainer } from "../../storybook";
|
|
5
|
-
import {
|
|
5
|
+
import { withMemoryRouter } from "~/storybook";
|
|
6
6
|
import { SectionItems } from "./drawer-section.mock";
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: "Drawers/DrawerSection",
|
|
10
10
|
component: DrawerSection,
|
|
11
|
-
decorators: [
|
|
11
|
+
decorators: [withMemoryRouter(), withContainer({ width: 250 })],
|
|
12
12
|
parameters: {
|
|
13
13
|
layout: "centered",
|
|
14
14
|
},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ComponentMeta } from "@storybook/react";
|
|
2
2
|
import { createTemplate } from "../../storybook";
|
|
3
3
|
import { Header } from "./header";
|
|
4
|
-
import {
|
|
4
|
+
import { withMemoryRouter } from "~/storybook";
|
|
5
5
|
import { breadcrumbs, tabs, actions } from "./header.dummy";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Sections/Header",
|
|
9
9
|
component: Header,
|
|
10
|
-
decorators: [
|
|
10
|
+
decorators: [withMemoryRouter()],
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: "fullscreen",
|
|
13
13
|
},
|
|
@@ -33,8 +33,6 @@ function renderInstance({
|
|
|
33
33
|
tabs?: HeaderTab[];
|
|
34
34
|
selectedTab?: number;
|
|
35
35
|
}) {
|
|
36
|
-
const onChangeTab = jest.fn();
|
|
37
|
-
|
|
38
36
|
const instance = render(
|
|
39
37
|
<TabProvider initialValue={selectedTab}>
|
|
40
38
|
<Header
|
|
@@ -49,7 +47,7 @@ function renderInstance({
|
|
|
49
47
|
</TabProvider>,
|
|
50
48
|
);
|
|
51
49
|
|
|
52
|
-
return { ...instance
|
|
50
|
+
return { ...instance };
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
describe("Header", () => {
|
|
@@ -149,7 +147,7 @@ describe("Header", () => {
|
|
|
149
147
|
});
|
|
150
148
|
|
|
151
149
|
it("would change the selected tab when a tab is clicked", async () => {
|
|
152
|
-
|
|
150
|
+
renderInstance({ tabs, selectedTab: 0 });
|
|
153
151
|
|
|
154
152
|
await userEvent.click(screen.getByRole("tab", { name: /tab 3/i }));
|
|
155
153
|
|
|
@@ -157,13 +155,5 @@ describe("Header", () => {
|
|
|
157
155
|
expect(screen.getByRole("tab", { name: /tab 2/i, selected: false })).toBeInTheDocument();
|
|
158
156
|
expect(screen.getByRole("tab", { name: /tab 3/i, selected: true })).toBeInTheDocument();
|
|
159
157
|
});
|
|
160
|
-
|
|
161
|
-
it("wouldn't call onChangeTab when the clicked tab is the selectedTab", async () => {
|
|
162
|
-
const { onChangeTab } = renderInstance({ tabs, selectedTab: 2 });
|
|
163
|
-
|
|
164
|
-
await userEvent.click(screen.getByRole("tab", { name: /tab 3/i }));
|
|
165
|
-
|
|
166
|
-
expect(onChangeTab).not.toHaveBeenCalled();
|
|
167
|
-
});
|
|
168
158
|
});
|
|
169
159
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Paper, Tabs, Tab, styled, tabsClasses } from "@mui/material";
|
|
2
|
-
import React, { PropsWithChildren
|
|
3
|
-
import {
|
|
2
|
+
import React, { PropsWithChildren } from "react";
|
|
3
|
+
import { useTab } from "~/providers";
|
|
4
4
|
|
|
5
5
|
const StyledTabs = styled(Tabs)(({ theme }) => ({
|
|
6
6
|
[`&.${tabsClasses.root}`]: {
|
|
@@ -76,13 +76,14 @@ describe("TableList", () => {
|
|
|
76
76
|
defaultSort = "value",
|
|
77
77
|
loading = false,
|
|
78
78
|
options = undefined,
|
|
79
|
+
onClick = jest.fn(),
|
|
79
80
|
}: {
|
|
80
81
|
defaultSort?: string;
|
|
81
82
|
loading?: boolean;
|
|
82
83
|
search?: boolean;
|
|
83
84
|
options?: TableRowOption<any>[];
|
|
85
|
+
onClick?: jest.Mock;
|
|
84
86
|
} = {}) => {
|
|
85
|
-
const onClick = jest.fn();
|
|
86
87
|
const instance = render(
|
|
87
88
|
<TableList
|
|
88
89
|
search={search}
|
|
@@ -221,6 +222,12 @@ describe("TableList", () => {
|
|
|
221
222
|
expect(onClick).toHaveBeenCalledWith(data[2]);
|
|
222
223
|
});
|
|
223
224
|
|
|
225
|
+
it("would continue working if onClick is not defined and we click a row", async () => {
|
|
226
|
+
renderInstance({ onClick: undefined });
|
|
227
|
+
|
|
228
|
+
await userEvents.click(screen.getByRole("row", { name: /item 3/i }));
|
|
229
|
+
});
|
|
230
|
+
|
|
224
231
|
describe("options menu", () => {
|
|
225
232
|
it("would render a button to open the menu if doesn't have options", () => {
|
|
226
233
|
renderInstance({ options: undefined });
|
|
@@ -27,7 +27,7 @@ export const TableList = <T extends BasicModelInstance>({
|
|
|
27
27
|
columns: columnsProp,
|
|
28
28
|
options,
|
|
29
29
|
data,
|
|
30
|
-
onClick
|
|
30
|
+
onClick,
|
|
31
31
|
search,
|
|
32
32
|
defaultSort,
|
|
33
33
|
defaultOrder,
|
|
@@ -62,10 +62,10 @@ export const TableList = <T extends BasicModelInstance>({
|
|
|
62
62
|
return (
|
|
63
63
|
<TableRow
|
|
64
64
|
key={row.id}
|
|
65
|
-
onClick={() => onClick(row)}
|
|
65
|
+
onClick={() => onClick && onClick(row)}
|
|
66
66
|
role="row"
|
|
67
67
|
aria-rowindex={i}
|
|
68
|
-
sx={{ cursor: "pointer" }}
|
|
68
|
+
sx={{ cursor: onClick && "pointer" }}
|
|
69
69
|
>
|
|
70
70
|
{columns.map(({ id }, j) => (
|
|
71
71
|
<TableCell role="cell" scope="row" key={id} aria-rowindex={i} aria-colindex={j}>
|