FormattedError

This commit is contained in:
Gregory Schier
2026-03-12 19:48:43 -07:00
parent 77ec87ea17
commit 3c4035097a
7 changed files with 6 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
import classNames from 'classnames';
import type { ReactNode } from 'react';
interface Props {
children: ReactNode;
className?: string;
}
export function FormattedError({ children, className }: Props) {
return (
<pre
className={classNames(
className,
'cursor-text select-auto',
'[&_*]:cursor-text [&_*]:select-auto',
'font-mono text-sm w-full bg-surface-highlight p-3 rounded',
'whitespace-pre-wrap border border-danger border-dashed overflow-x-auto',
)}
>
{children}
</pre>
);
}

View File

@@ -9,6 +9,7 @@ export type { IconProps } from './components/Icon';
export { Icon } from './components/Icon';
export type { IconButtonProps } from './components/IconButton';
export { IconButton } from './components/IconButton';
export { FormattedError } from './components/FormattedError';
export { InlineCode } from './components/InlineCode';
export { LoadingIcon } from './components/LoadingIcon';
export { Overlay } from './components/Overlay';