fix(managers): key the row-layout primary cell + measured rowEst
Self-review follow-ups: the `rows` layout mapped the primary column without a React key (single-element today, but a warning waiting to happen); wrap it in a keyed Fragment. Also replace the guessed card/row rowEst with browser-measured values (176 / 62) so the scrollbar doesn't jump on first scroll.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Fragment } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { type Column } from "./DataTable";
|
||||
import VirtualGrid from "./VirtualGrid";
|
||||
@@ -68,7 +69,11 @@ export default function ChannelLayoutGrid<T>({
|
||||
|
||||
const renderRow = (row: T) => (
|
||||
<div className={`glass-card rounded-xl p-3 flex items-center gap-4 ${rowClassName?.(row) ?? ""}`}>
|
||||
<div className="shrink-0 font-medium">{primary.map((col) => col.render(row))}</div>
|
||||
<div className="shrink-0 font-medium">
|
||||
{primary.map((col) => (
|
||||
<Fragment key={col.key}>{col.render(row)}</Fragment>
|
||||
))}
|
||||
</div>
|
||||
{metaFlow(row)}
|
||||
{actions && <div className="ml-auto shrink-0">{actions.render(row)}</div>}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user