feat(web): support auto row height for multi-line invoice cells

Refs: AP-44
This commit is contained in:
Adam Moussa 2026-08-11 15:35:27 -04:00
parent 8b75835310
commit e23ba0f4bb
No known key found for this signature in database

View file

@ -7,6 +7,7 @@ type MockDataGridProps<R extends GridValidRowModel> = DataGridProps<R> & {
export function MockDataGrid<R extends GridValidRowModel>({
"data-testid": testId,
sx,
getRowHeight,
...props
}: MockDataGridProps<R>) {
return (
@ -20,6 +21,7 @@ export function MockDataGrid<R extends GridValidRowModel>({
pagination: { paginationModel: { pageSize: 10, page: 0 } },
}}
getRowId={(row) => row.id as string}
getRowHeight={getRowHeight ?? (() => "auto")}
sx={[
{
border: 1,
@ -31,6 +33,15 @@ export function MockDataGrid<R extends GridValidRowModel>({
"& .MuiDataGrid-cell": {
borderBottom: "1px solid",
borderColor: "divider",
py: 1,
alignItems: "flex-start",
display: "flex",
},
"& .MuiDataGrid-cellContent": {
whiteSpace: "normal",
wordBreak: "break-word",
lineHeight: 1.35,
width: "100%",
},
"& .MuiDataGrid-row:last-of-type .MuiDataGrid-cell": {
borderBottom: "none",