diff --git a/packages/admin-next/dashboard/src/components/table/data-table/data-table-root/data-table-root.tsx b/packages/admin-next/dashboard/src/components/table/data-table/data-table-root/data-table-root.tsx index be3774e014..99ebdf4674 100644 --- a/packages/admin-next/dashboard/src/components/table/data-table/data-table-root/data-table-root.tsx +++ b/packages/admin-next/dashboard/src/components/table/data-table/data-table-root/data-table-root.tsx @@ -14,7 +14,7 @@ import { useState, } from "react" import { useTranslation } from "react-i18next" -import { useNavigate } from "react-router-dom" +import { Link, useNavigate } from "react-router-dom" import { NoResults } from "../../../common/empty-table-content" type BulkCommand = { @@ -86,7 +86,7 @@ export const DataTableRoot = ({ const navigate = useNavigate() const [showStickyBorder, setShowStickyBorder] = useState(false) - const scrollableRef = useRef() + const scrollableRef = useRef(null) const hasSelect = columns.find((c) => c.id === "select") const hasActions = columns.find((c) => c.id === "actions") @@ -199,12 +199,15 @@ export const DataTableRoot = ({ const isOdd = row.depth % 2 !== 0 + const cells = row.getVisibleCells() + return ( ({ isRowDisabled, } )} - onClick={to ? () => navigate(to) : undefined} > - {row.getVisibleCells().map((cell, index) => { + {cells.map((cell, index) => { const visibleCells = row.getVisibleCells() const isSelectCell = cell.column.id === "select" @@ -239,11 +241,18 @@ export const DataTableRoot = ({ ? row.depth * 14 + 24 : undefined + const Inner = flexRender( + cell.column.columnDef.cell, + cell.getContext() + ) + + const isTabableLink = index === 0 && !!to + return ( ({ : undefined, }} > - {flexRender( - cell.column.columnDef.cell, - cell.getContext() + {to ? ( + + {Inner} + + ) : ( + Inner )} )