DefaultErrorRenderer.tsx20 lines · main
| 1 | import { CodeBlock } from 'ui-patterns/CodeBlock' |
| 2 | |
| 3 | import type { LogQueryError } from '../Logs.types' |
| 4 | |
| 5 | export interface ErrorRendererProps { |
| 6 | error: LogQueryError |
| 7 | isCustomQuery: boolean |
| 8 | } |
| 9 | |
| 10 | export const DefaultErrorRenderer: React.FC<ErrorRendererProps> = ({ error }) => ( |
| 11 | <div className="w-full prose min-w-full text-foreground text-sm"> |
| 12 | <CodeBlock |
| 13 | title="Error fetching logs" |
| 14 | language="json" |
| 15 | hideLineNumbers |
| 16 | value={typeof error === 'string' ? error : JSON.stringify(error, null, 2)} |
| 17 | className="w-full font-mono" |
| 18 | /> |
| 19 | </div> |
| 20 | ) |