Skip to content

Commit

Permalink
chore: Refactor all case results to be in the same table.
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Dec 5, 2024
1 parent 82d5467 commit c24f280
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const SubRowResult = ({
if (!has) resultFiles.push(file);
}),
);
console.log(resultFiles);

if (resultFiles && resultFiles.length > 0) setResultImages(resultFiles);
setOpen(!open);
Expand All @@ -49,12 +48,7 @@ export const SubRowResult = ({
</Button>
</Styled.SubRowInfo>
<Styled.TableList>
{resultRows.map((r) => (
<SubRowResultItem
key={r.computeCaseId + r.quality}
resultItem={r}
></SubRowResultItem>
))}
<SubRowResultItem resultList={resultRows}></SubRowResultItem>
</Styled.TableList>
</Styled.SubRowDiv>
<ImageResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { ResultObjectType } from '../TanStackTable/TanStackTable';
import * as Styled from './SubRowResultItem.styled';

export const SubRowResultItem = ({
resultItem,
resultList,
}: {
resultItem: ResultObjectType;
resultList: ResultObjectType[];
}) => {
return (
<Styled.TableWrapper>
<Table>
<Table.Head>
<Table.Row>
<Table.Cell>{resultItem.variogramModel}</Table.Cell>
<Table.Cell>{resultList[0].variogramModel}</Table.Cell>
<Table.Cell></Table.Cell>
<Table.Cell></Table.Cell>
<Table.Cell></Table.Cell>
Expand All @@ -27,13 +27,15 @@ export const SubRowResultItem = ({
</Styled.HeaderContent>
</Table.Head>
<Table.Body>
<Table.Row>
<Table.Cell>{resultItem.rmajor}</Table.Cell>
<Table.Cell>{resultItem.rminor}</Table.Cell>
<Table.Cell>{resultItem.azimuth}</Table.Cell>
<Table.Cell>{resultItem.rvertical}</Table.Cell>
<Table.Cell>{resultItem.sigma}</Table.Cell>
</Table.Row>
{resultList.map((resultItem) => (
<Table.Row key={resultItem.computeCaseId + resultItem.quality}>
<Table.Cell>{resultItem.rmajor}</Table.Cell>
<Table.Cell>{resultItem.rminor}</Table.Cell>
<Table.Cell>{resultItem.azimuth}</Table.Cell>
<Table.Cell>{resultItem.rvertical}</Table.Cell>
<Table.Cell>{resultItem.sigma}</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
</Styled.TableWrapper>
Expand Down

0 comments on commit c24f280

Please sign in to comment.