forked from mtxr/vscode-sqltools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 4 additions & 23 deletions
27
packages/plugins/connection-manager/ui/screens/Results/components/Table/ValueRender.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
import React from 'react'; | ||
export const ValueRender = ({ value }) => { | ||
if (value === null) | ||
return <small className='cell-value value-null'>NULL</small>; | ||
if (typeof value === 'number') | ||
return <span className='cell-value value-number'>{value}</span>; | ||
if (value === null) return <small className="cell-value value-null">NULL</small>; | ||
if (typeof value === 'number') return <span className="cell-value value-number">{value}</span>; | ||
if (value === true || value === false) | ||
return <span className={`cell-value value-bool ${value.toString()}`}>{value.toString().toUpperCase()}</span>; | ||
if (typeof value === 'object' || Array.isArray(value)) { | ||
return (<>{JSON.stringify(value, null, 2)}</>); | ||
return <>{JSON.stringify(value, null, 2)}</>; | ||
} | ||
return <>{String(value)}</>; | ||
// DISABLE! Performance issues here | ||
// return <span> | ||
// { | ||
// value.replace(this.state.filtered[r.column.id].regex || this.state.filtered[r.column.id].value, '<###>$1<###>') | ||
// .split('<###>') | ||
// .map((str, i) => { | ||
// if (i % 2 === 1) | ||
// return ( | ||
// <mark key={i} className="filter-highlight"> | ||
// {str} | ||
// </mark> | ||
// ); | ||
// if (str.trim().length === 0) return null; | ||
// return <span key={i}>{str}</span>; | ||
// }) | ||
// } | ||
// </span> | ||
}; | ||
|
||
export default ValueRender; | ||
export default ValueRender; |