import React from 'react'; import SyntaxHighlighter from 'react-syntax-highlighter'; import { github } from 'react-syntax-highlighter/dist/styles'; const SqlShrink = (props) => { let lines = props.sql.split('\n'); if (lines.length >= props.maxLines) { lines = lines.slice(0, props.maxLines); lines.push('{...}'); } const shrunk = lines.map((line) => { if (line.length > props.maxWidth) { return line.slice(0, props.maxWidth) + '{...}'; } return line; }) .join('\n'); return (