Separated multiline cell renderer into different component

This commit is contained in:
Lucas Oliveira 2024-06-05 17:44:48 -03:00
commit 6955e7e6df
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,11 @@
import { CustomCellRendererProps } from "ag-grid-react";
export default function TableMultilineCellRender({
value,
}: CustomCellRendererProps) {
return (
<span className="text-wrap py-2.5 leading-5 truncate-multiline">
{value}
</span>
);
}

View file

@ -4,6 +4,7 @@ import TableAutoCellRender from "../../../components/tableComponent/components/t
import TableNodeCellRender from "../../../components/tableComponent/components/tableNodeCellRender";
import TableToggleCellRender from "../../../components/tableComponent/components/tableToggleCellRender";
import TableTooltipRender from "../../../components/tableComponent/components/tableTooltipRender";
import TableMultilineCellRender from "../../../components/tableComponent/components/tableMultilineCellRender";
const useColumnDefs = (
myData: any,
@ -33,7 +34,7 @@ const useColumnDefs = (
field: "info",
tooltipField: "info",
tooltipComponent: TableTooltipRender,
cellRenderer: TableAutoCellRender,
cellRenderer: TableMultilineCellRender,
autoHeight: true,
flex: 2,
resizable: false,