Minor fix to ActionsColumn function

No longer uses hooks but instead takes in the title
This commit is contained in:
Donkie
2024-08-07 12:40:54 +02:00
parent 736e59d1eb
commit 8413e33895
4 changed files with 8 additions and 7 deletions

View File

@@ -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) => {