|
|
|
@ -2,16 +2,16 @@ import { isString } from 'lodash'; |
|
|
|
|
import React from 'react'; |
|
|
|
|
|
|
|
|
|
import { ClipboardButton } from '../ClipboardButton/ClipboardButton'; |
|
|
|
|
import { Modal } from '../Modal/Modal'; |
|
|
|
|
import { Drawer } from '../Drawer/Drawer'; |
|
|
|
|
import { CodeEditor } from '../Monaco/CodeEditor'; |
|
|
|
|
|
|
|
|
|
interface TableCellInspectModalProps { |
|
|
|
|
interface TableCellInspectorProps { |
|
|
|
|
value: any; |
|
|
|
|
onDismiss: () => void; |
|
|
|
|
mode: 'code' | 'text'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function TableCellInspectModal({ value, onDismiss, mode }: TableCellInspectModalProps) { |
|
|
|
|
export function TableCellInspector({ value, onDismiss, mode }: TableCellInspectorProps) { |
|
|
|
|
let displayValue = value; |
|
|
|
|
if (isString(value)) { |
|
|
|
|
const trimmedValue = value.trim(); |
|
|
|
@ -36,7 +36,7 @@ export function TableCellInspectModal({ value, onDismiss, mode }: TableCellInspe |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Modal onDismiss={onDismiss} isOpen={true} title="Inspect value"> |
|
|
|
|
<Drawer onClose={onDismiss} title="Inspect value"> |
|
|
|
|
{mode === 'code' ? ( |
|
|
|
|
<CodeEditor |
|
|
|
|
width="100%" |
|
|
|
@ -50,11 +50,9 @@ export function TableCellInspectModal({ value, onDismiss, mode }: TableCellInspe |
|
|
|
|
) : ( |
|
|
|
|
<pre>{text}</pre> |
|
|
|
|
)} |
|
|
|
|
<Modal.ButtonRow> |
|
|
|
|
<ClipboardButton icon="copy" getText={() => text}> |
|
|
|
|
Copy to Clipboard |
|
|
|
|
</ClipboardButton> |
|
|
|
|
</Modal.ButtonRow> |
|
|
|
|
</Modal> |
|
|
|
|
<ClipboardButton icon="copy" getText={() => text}> |
|
|
|
|
Copy to Clipboard |
|
|
|
|
</ClipboardButton> |
|
|
|
|
</Drawer> |
|
|
|
|
); |
|
|
|
|
} |