Simplify passing similar props

This commit is contained in:
Robert
2023-08-21 14:52:42 +01:00
parent bd5d361de1
commit eebe11e5dd
2 changed files with 2 additions and 17 deletions

View File

@@ -29,9 +29,6 @@ export function AlertTablePathRow(props: Props) {
resultIndex,
currentPathExpanded,
selectedItem,
databaseUri,
sourceLocationPrefix,
updateSelectionCallback,
toggleExpanded,
scroller,
} = props;
@@ -71,15 +68,9 @@ export function AlertTablePathRow(props: Props) {
path.locations.map((step, pathNodeIndex) => (
<AlertTablePathNodeRow
key={`${resultIndex}-${pathIndex}-${pathNodeIndex}`}
{...props}
step={step}
pathNodeIndex={pathNodeIndex}
pathIndex={pathIndex}
resultIndex={resultIndex}
selectedItem={selectedItem}
databaseUri={databaseUri}
sourceLocationPrefix={sourceLocationPrefix}
updateSelectionCallback={updateSelectionCallback}
scroller={scroller}
/>
))}
</>

View File

@@ -112,18 +112,12 @@ export function AlertTableResultRow(props: Props) {
Keys.getAllPaths(result).map((path, pathIndex) => (
<AlertTablePathRow
key={`${resultIndex}-${pathIndex}`}
{...props}
path={path}
pathIndex={pathIndex}
resultIndex={resultIndex}
currentPathExpanded={expanded.has(
Keys.keyToString({ resultIndex, pathIndex }),
)}
selectedItem={selectedItem}
databaseUri={databaseUri}
sourceLocationPrefix={sourceLocationPrefix}
updateSelectionCallback={updateSelectionCallback}
toggleExpanded={toggleExpanded}
scroller={scroller}
/>
))}
</>