refactor(codeAreaModal/v2.tsx): improve code readability and error display in CodeAreaModal component

The changes in this commit include:
- Added `overflow-y-scroll` and `overflow-x-clip` classes to the error message container to enable vertical scrolling and prevent horizontal scrolling.
- Added `break-all` class to the error message and traceback to ensure long lines of text are broken and wrapped within the container.
- Added `whitespace-pre-wrap` class to the error message to preserve whitespace and line breaks.

These changes were made to improve the readability of the code and enhance the display of error messages in the CodeAreaModal component.
This commit is contained in:
anovazzi1 2023-07-06 19:30:37 -03:00
commit 0733b56b8f

View file

@ -141,9 +141,9 @@ export default function CodeAreaModal({
/>
</div>
<div className={"w-full transition-all delay-500 " + (error?.detail.error !== undefined ? "h-2/6" : "h-0")}>
<div className="w-full h-full overflow-auto custom-scroll text-left mt-1">
<div className="w-full h-full overflow-y-scroll overflow-x-clip custom-scroll text-left mt-1">
<h1 className="text-destructive text-lg">{error?.detail?.error}</h1>
<div className="text-status-red text-sm ml-2"><pre>{error?.detail?.traceback}</pre></div>
<div className="text-status-red text-sm ml-2 w-full break-all"><pre className="w-full break-all whitespace-pre-wrap">{error?.detail?.traceback}</pre></div>
</div>
</div>
<div className="h-fit w-full flex justify-end">