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