vis-convert-error.tsx 615 B

123456789101112131415161718192021222324
  1. import { formatSql } from '@/utils';
  2. import { CodePreview } from './code-preview';
  3. interface Props {
  4. data: {
  5. display_type: string;
  6. sql: string;
  7. thought: string;
  8. };
  9. }
  10. function VisConvertError({ data }: Props) {
  11. return (
  12. <div className='rounded overflow-hidden'>
  13. <div className='p-3 text-white bg-red-500 whitespace-normal'>{data.display_type}</div>
  14. <div className='p-3 bg-red-50'>
  15. <div className='mb-2 whitespace-normal'>{data.thought}</div>
  16. <CodePreview code={formatSql(data.sql)} language='sql' />
  17. </div>
  18. </div>
  19. );
  20. }
  21. export default VisConvertError;