mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
move Action getActionName util fn to DisplayCell.tsx
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import { IDisplayCellProps } from "@src/components/fields/types";
|
||||
import { get } from "lodash-es";
|
||||
|
||||
export default function Action({ name, value }: IDisplayCellProps) {
|
||||
return <>{value ? value.status : name}</>;
|
||||
export const getActionName = (column: IDisplayCellProps["column"]) => {
|
||||
const config = get(column, "config");
|
||||
if (!get(config, "customName.enabled")) {
|
||||
return get(column, "name");
|
||||
}
|
||||
return get(config, "customName.actionName") || get(column, "name");
|
||||
};
|
||||
|
||||
export default function Action({ value, column }: IDisplayCellProps) {
|
||||
return <>{value ? value.status : getActionName(column)}</>;
|
||||
}
|
||||
|
||||
@@ -4,15 +4,7 @@ import { Stack } from "@mui/material";
|
||||
|
||||
import ActionFab from "./ActionFab";
|
||||
import { sanitiseCallableName, isUrl } from "./utils";
|
||||
import { get } from "lodash-es";
|
||||
|
||||
export const getActionName = (column: any) => {
|
||||
const config = get(column, "config");
|
||||
if (!get(config, "customName.enabled")) {
|
||||
return get(column, "name");
|
||||
}
|
||||
return get(config, "customName.actionName") || get(column, "name");
|
||||
};
|
||||
import { getActionName } from "./DisplayCell";
|
||||
|
||||
export default function Action({
|
||||
column,
|
||||
|
||||
@@ -10,7 +10,7 @@ import ActionFab from "./ActionFab";
|
||||
import { tableScope, tableRowsAtom } from "@src/atoms/tableScope";
|
||||
import { fieldSx, getFieldId } from "@src/components/SideDrawer/utils";
|
||||
import { sanitiseCallableName, isUrl } from "./utils";
|
||||
import { getActionName } from "./TableCell";
|
||||
import { getActionName } from "./DisplayCell";
|
||||
|
||||
export default function Action({
|
||||
column,
|
||||
|
||||
Reference in New Issue
Block a user