fix(web): Fix sql format error (#1319)

This commit is contained in:
Hzh_97
2024-03-21 17:41:25 +08:00
committed by GitHub
parent 86a7b6c6f3
commit 04322de4f3
49 changed files with 69256 additions and 236 deletions

View File

@@ -1,5 +1,5 @@
import { format } from 'sql-formatter';
import { CodePreview } from './code-preview';
import { formatSql } from '@/utils';
interface Props {
data: {
@@ -15,7 +15,7 @@ function VisConvertError({ data }: Props) {
<div className="p-3 text-white bg-red-500 whitespace-normal">{data.display_type}</div>
<div className="p-3 bg-red-50">
<div className="mb-2 whitespace-normal">{data.thought}</div>
<CodePreview code={format(data.sql)} language="sql" />
<CodePreview code={formatSql(data.sql)} language="sql" />
</div>
</div>
);