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 {
|
||||
const t = useTranslate();
|
||||
|
||||
export function ActionsColumn<Obj extends Entity>(
|
||||
title: string,
|
||||
actionsFn: (record: Obj) => Action[]
|
||||
): ColumnType<Obj> | undefined {
|
||||
return {
|
||||
title: t("table.actions"),
|
||||
title,
|
||||
responsive: ["lg"],
|
||||
render: (_, record) => {
|
||||
const buttons = actionsFn(record).map((action) => {
|
||||
|
||||
@@ -343,7 +343,7 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
|
||||
i18ncat: "filament",
|
||||
width: 150,
|
||||
}),
|
||||
ActionsColumn(actions),
|
||||
ActionsColumn(t("table.actions"), actions),
|
||||
])}
|
||||
/>
|
||||
</List>
|
||||
|
||||
@@ -465,7 +465,7 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
||||
i18ncat: "spool",
|
||||
width: 150,
|
||||
}),
|
||||
ActionsColumn(actions),
|
||||
ActionsColumn(t("table.actions"), actions),
|
||||
])}
|
||||
/>
|
||||
</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",
|
||||
i18ncat: "vendor",
|
||||
}),
|
||||
ActionsColumn<IVendor>(actions),
|
||||
ActionsColumn<IVendor>(t("table.actions"), actions),
|
||||
])}
|
||||
/>
|
||||
</List>
|
||||
|
||||
Reference in New Issue
Block a user