fix: remove the second action button in the dashboards table (#3012)

This commit is contained in:
dnazarenkoo 2023-07-04 07:20:12 +03:00 committed by GitHub
parent 20e71ec08a
commit 78da014b52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,8 +75,8 @@ function ListOfAllDashboard(): JSX.Element {
errorMessage: '', errorMessage: '',
}); });
const columns: TableColumnProps<Data>[] = useMemo( const columns = useMemo(() => {
() => [ const tableColumns: TableColumnProps<Data>[] = [
{ {
title: 'Name', title: 'Name',
dataIndex: 'name', dataIndex: 'name',
@ -118,19 +118,19 @@ function ListOfAllDashboard(): JSX.Element {
}, },
render: DateComponent, render: DateComponent,
}, },
], ];
[],
);
if (action) { if (action) {
columns.push({ tableColumns.push({
title: 'Action', title: 'Action',
dataIndex: '', dataIndex: '',
key: 'x', width: 40,
width: 40, render: DeleteButton,
render: DeleteButton, });
}); }
}
return tableColumns;
}, [action]);
const data: Data[] = (filteredDashboards || dashboards).map((e) => ({ const data: Data[] = (filteredDashboards || dashboards).map((e) => ({
createdBy: e.created_at, createdBy: e.created_at,