|
1 | 1 | import * as React from "react"; |
2 | 2 |
|
3 | 3 | import { SetComparisonsMessage } from "../../common/interface-types"; |
4 | | -import RawTableHeader from "../results/RawTableHeader"; |
5 | 4 | import { className } from "../results/result-table-utils"; |
6 | | -import { ResultRow } from "../../common/bqrs-cli-types"; |
7 | | -import RawTableRow from "../results/RawTableRow"; |
8 | 5 | import { vscode } from "../vscode-api"; |
9 | | -import { sendTelemetry } from "../common/telemetry"; |
10 | 6 | import TextButton from "../common/TextButton"; |
11 | 7 | import { styled } from "styled-components"; |
| 8 | +import { RawCompareResultTable } from "./RawCompareResultTable"; |
12 | 9 |
|
13 | 10 | interface Props { |
14 | 11 | comparison: SetComparisonsMessage; |
@@ -40,24 +37,6 @@ export default function CompareTable(props: Props) { |
40 | 37 | }); |
41 | 38 | } |
42 | 39 |
|
43 | | - function createRows(rows: ResultRow[], databaseUri: string) { |
44 | | - return ( |
45 | | - <tbody> |
46 | | - {rows.map((row, rowIndex) => ( |
47 | | - <RawTableRow |
48 | | - key={rowIndex} |
49 | | - rowIndex={rowIndex} |
50 | | - row={row} |
51 | | - databaseUri={databaseUri} |
52 | | - onSelected={() => { |
53 | | - sendTelemetry("comapre-view-result-clicked"); |
54 | | - }} |
55 | | - /> |
56 | | - ))} |
57 | | - </tbody> |
58 | | - ); |
59 | | - } |
60 | | - |
61 | 40 | return ( |
62 | 41 | <Table> |
63 | 42 | <thead> |
@@ -85,24 +64,22 @@ export default function CompareTable(props: Props) { |
85 | 64 | <tbody> |
86 | 65 | <tr> |
87 | 66 | <td> |
88 | | - <table className={className}> |
89 | | - <RawTableHeader |
90 | | - columns={result.columns} |
91 | | - schemaName={comparison.currentResultSetName} |
92 | | - preventSort={true} |
93 | | - /> |
94 | | - {createRows(result.from, comparison.databaseUri)} |
95 | | - </table> |
| 67 | + <RawCompareResultTable |
| 68 | + columns={result.columns} |
| 69 | + schemaName={comparison.currentResultSetName} |
| 70 | + rows={result.from} |
| 71 | + databaseUri={comparison.databaseUri} |
| 72 | + className={className} |
| 73 | + /> |
96 | 74 | </td> |
97 | 75 | <td> |
98 | | - <table className={className}> |
99 | | - <RawTableHeader |
100 | | - columns={result.columns} |
101 | | - schemaName={comparison.currentResultSetName} |
102 | | - preventSort={true} |
103 | | - /> |
104 | | - {createRows(result.to, comparison.databaseUri)} |
105 | | - </table> |
| 76 | + <RawCompareResultTable |
| 77 | + columns={result.columns} |
| 78 | + schemaName={comparison.currentResultSetName} |
| 79 | + rows={result.to} |
| 80 | + databaseUri={comparison.databaseUri} |
| 81 | + className={className} |
| 82 | + /> |
106 | 83 | </td> |
107 | 84 | </tr> |
108 | 85 | </tbody> |
|
0 commit comments