@@ -98,61 +98,6 @@ export const Preview: FC<PreviewProps> = ({
9898 } , 100 ) ;
9999 } ;
100100
101- // useEffect(() => {
102- // if (wasmLoadState === "loading" || !window.go_preview) {
103- // return;
104- // }
105-
106- // // const getOutput = async () => {
107- // // try {
108- // // const rawOutput = await window.go_preview?.(
109- // // {
110- // // "main.tf": code,
111- // // "checker/main.tf": checkerModule,
112- // // },
113- // // $owner,
114- // // $form,
115- // // );
116-
117- // // if (rawOutput === undefined) {
118- // // console.error("Something went wrong");
119- // // } else {
120- // // const output = JSON.parse(rawOutput) as PreviewOutput;
121- // // setOutput(() => output);
122-
123- // // const errors = outputToDiagnostics(output);
124- // // $setError(errors);
125-
126- // // if (output.diags.length === 0) {
127- // // $setParameters(output.output?.parameters ?? []);
128- // // }
129- // // }
130- // // } catch (e) {
131- // // console.error(e);
132- // // if (e instanceof Error) {
133- // // const diagnostic: InternalDiagnostic = {
134- // // severity: "error",
135- // // summary: e.name,
136- // // detail: e.message,
137- // // kind: "internal",
138- // // };
139- // // $setError([diagnostic]);
140- // // } else {
141- // // const diagnostic: InternalDiagnostic = {
142- // // severity: "error",
143- // // summary: "Error",
144- // // detail: "Something went wrong",
145- // // kind: "internal",
146- // // };
147-
148- // // $setError([diagnostic]);
149- // // }
150- // // }
151- // // };
152-
153- // // getOutput();
154- // }, [code, $setError, wasmLoadState, $setParameters, $form, $owner]);
155-
156101 return (
157102 < Tabs . Root
158103 defaultValue = "preview"
0 commit comments