import { format } from 'sql-formatter' import { CodeBlock, cn } from 'ui' interface SQLCodeBlockProps { children: string[] projectRef: string } export const SQLCodeBlock = ({ children }: SQLCodeBlockProps) => { let formatted = (children || [''])[0] try { formatted = format(formatted, { language: 'postgresql', keywordCase: 'upper', }) } catch {} if (formatted.length === 0) { return null } return (
code]:m-0 [&>code>span]:flex [&>code>span]:flex-wrap'
)}
hideCopy
hideLineNumbers
/>
)
}