Minor fix to ActionsColumn function
No longer uses hooks but instead takes in the title
This commit is contained in:
@@ -266,11 +266,12 @@ export function DateColumn<Obj extends Entity>(props: BaseColumnProps<Obj>) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ActionsColumn<Obj extends Entity>(actionsFn: (record: Obj) => Action[]): ColumnType<Obj> | undefined {
|
export function ActionsColumn<Obj extends Entity>(
|
||||||
const t = useTranslate();
|
title: string,
|
||||||
|
actionsFn: (record: Obj) => Action[]
|
||||||
|
): ColumnType<Obj> | undefined {
|
||||||
return {
|
return {
|
||||||
title: t("table.actions"),
|
title,
|
||||||
responsive: ["lg"],
|
responsive: ["lg"],
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const buttons = actionsFn(record).map((action) => {
|
const buttons = actionsFn(record).map((action) => {
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
|
|||||||
i18ncat: "filament",
|
i18ncat: "filament",
|
||||||
width: 150,
|
width: 150,
|
||||||
}),
|
}),
|
||||||
ActionsColumn(actions),
|
ActionsColumn(t("table.actions"), actions),
|
||||||
])}
|
])}
|
||||||
/>
|
/>
|
||||||
</List>
|
</List>
|
||||||
|
|||||||
@@ -465,7 +465,7 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
|||||||
i18ncat: "spool",
|
i18ncat: "spool",
|
||||||
width: 150,
|
width: 150,
|
||||||
}),
|
}),
|
||||||
ActionsColumn(actions),
|
ActionsColumn(t("table.actions"), actions),
|
||||||
])}
|
])}
|
||||||
/>
|
/>
|
||||||
</List>
|
</List>
|
||||||
|
|||||||
2
client/src/pages/vendors/list.tsx
vendored
2
client/src/pages/vendors/list.tsx
vendored
@@ -202,7 +202,7 @@ export const VendorList: React.FC<IResourceComponentsProps> = () => {
|
|||||||
id: "comment",
|
id: "comment",
|
||||||
i18ncat: "vendor",
|
i18ncat: "vendor",
|
||||||
}),
|
}),
|
||||||
ActionsColumn<IVendor>(actions),
|
ActionsColumn<IVendor>(t("table.actions"), actions),
|
||||||
])}
|
])}
|
||||||
/>
|
/>
|
||||||
</List>
|
</List>
|
||||||
|
|||||||
Reference in New Issue
Block a user