[playground] Remove button from error message

We show the entire error in panel, no need to click to console.log 

This makes it easier to copy the error now. 

Before: 


https://github.com/facebook/react-forget/assets/565765/4c13abfe-a06d-4580-b3d7-b02792f53e57 

After: 


https://github.com/facebook/react-forget/assets/565765/0dff95cc-5207-48a5-a0b6-2055cadcb780
This commit is contained in:
Sathya Gunasekaran
2023-11-16 12:01:59 +00:00
parent 369c315ac4
commit eacf189eca
@@ -17,7 +17,7 @@ import { type CompilerError } from "babel-plugin-react-forget";
import parserBabel from "prettier/plugins/babel";
import * as prettierPluginEstree from "prettier/plugins/estree";
import * as prettier from "prettier/standalone";
import { memo, useCallback, useEffect, useState } from "react";
import { memo, useEffect, useState } from "react";
import { type Store } from "../../lib/stores";
import TabbedWindow from "../TabbedWindow";
import { monacoOptions } from "./monacoOptions";
@@ -187,12 +187,6 @@ function Output({ store, compilerOutput }: Props) {
});
}, [store.source, compilerOutput]);
const consoleLogError = useCallback(() => {
if (compilerOutput.kind === "err") {
console.error(compilerOutput.error);
}
}, [compilerOutput]);
return (
<>
<TabbedWindow
@@ -213,13 +207,7 @@ function Output({ store, compilerOutput }: Props) {
className="p-4 basis-full text-red-600 overflow-y-scroll whitespace-pre-wrap"
style={{ width: "calc(100vw - 650px)", height: "150px" }}
>
<button
className="text-left"
title="Log error to console"
onClick={() => consoleLogError()}
>
<code>{compilerOutput.error.toString()}</code>
</button>
<code>{compilerOutput.error.toString()}</code>
</pre>
</div>
) : null}