11import * as React from "react" ;
22import { useState } from "react" ;
33import { styled } from "styled-components" ;
4- import {
5- CellValue ,
6- RawResultSet ,
7- ResultSetSchema ,
8- } from "../../common/bqrs-cli-types" ;
4+ import { RawResultSet , ResultSetSchema } from "../../common/bqrs-cli-types" ;
95import TextButton from "../common/TextButton" ;
106import { useTelemetryOnChange } from "../common/telemetry" ;
11- import { RawResultCell } from "./RawResultCell " ;
7+ import { RawResultRow } from "./RawResultRow " ;
128
139const numOfResultsInContractedMode = 5 ;
1410
15- const StyledRow = styled . div `
16- border-color: var(--vscode-editor-snippetFinalTabstopHighlightBorder);
17- border-style: solid;
18- justify-content: center;
19- align-items: center;
20- padding: 0.4rem;
21- word-break: break-word;
22- ` ;
23-
2411type TableContainerProps = {
2512 columnCount : number ;
2613} ;
@@ -38,26 +25,6 @@ const TableContainer = styled.div<TableContainerProps>`
3825 padding: 0.4rem;
3926` ;
4027
41- type RowProps = {
42- row : CellValue [ ] ;
43- fileLinkPrefix : string ;
44- sourceLocationPrefix : string ;
45- } ;
46-
47- const Row = ( { row, fileLinkPrefix, sourceLocationPrefix } : RowProps ) => (
48- < >
49- { row . map ( ( cell , cellIndex ) => (
50- < StyledRow key = { cellIndex } >
51- < RawResultCell
52- value = { cell }
53- fileLinkPrefix = { fileLinkPrefix }
54- sourceLocationPrefix = { sourceLocationPrefix }
55- />
56- </ StyledRow >
57- ) ) }
58- </ >
59- ) ;
60-
6128type RawResultsTableProps = {
6229 schema : ResultSetSchema ;
6330 results : RawResultSet ;
@@ -86,7 +53,7 @@ const RawResultsTable = ({
8653 < >
8754 < TableContainer columnCount = { schema . columns . length } >
8855 { results . rows . slice ( 0 , numOfResultsToShow ) . map ( ( row , rowIndex ) => (
89- < Row
56+ < RawResultRow
9057 key = { rowIndex }
9158 row = { row }
9259 fileLinkPrefix = { fileLinkPrefix }
0 commit comments