@@ -1771,76 +1771,6 @@ module Button3 = {
1771
1771
| _ => [||]
1772
1772
};
1773
1773
1774
- let controlPanel =
1775
- switch (compilerState) {
1776
- | Ready (ready )
1777
- | Compiling (ready , _ )
1778
- | SwitchingCompiler (ready , _ , _ ) =>
1779
- let availableTargetLangs =
1780
- Api . Version . availableLanguages(ready. selected. apiVersion);
1781
-
1782
- let selectedTargetLang =
1783
- switch (ready. targetLang) {
1784
- | Res => (Api . Lang . Res , ready. selected. compilerVersion)
1785
- | Reason => (Reason , ready. selected. reasonVersion)
1786
- | OCaml => (OCaml , ready. selected. ocamlVersion)
1787
- };
1788
-
1789
- let onCompilerSelect = id => {
1790
- compilerDispatch(
1791
- SwitchToCompiler ({id, libraries: ready. selected. libraries}),
1792
- );
1793
- };
1794
-
1795
- let onTargetLangSelect = lang => {
1796
- compilerDispatch(
1797
- SwitchLanguage ({lang, code: React . Ref . current(editorCode)}),
1798
- );
1799
- };
1800
-
1801
- let onCompileClick = () => {
1802
- compilerDispatch(
1803
- CompileCode (ready. targetLang, React . Ref . current(editorCode)),
1804
- );
1805
- };
1806
-
1807
- // When a new compiler version was selected, it should
1808
- // be shown in the control panel as the currently selected
1809
- // version, even when it is currently loading
1810
- let compilerVersion =
1811
- switch (compilerState) {
1812
- | SwitchingCompiler (_ , version , _ ) => version
1813
- | _ => ready. selected. id
1814
- };
1815
-
1816
- let onFormatClick = () => {
1817
- compilerDispatch(Format (React . Ref . current(editorCode)));
1818
- };
1819
-
1820
- let isCompilerSwitching =
1821
- switch (compilerState) {
1822
- | SwitchingCompiler (_ , _ , _ ) => true
1823
- | _ => false
1824
- };
1825
-
1826
- <>
1827
- <ControlPanelOld
1828
- isCompilerSwitching
1829
- compilerVersion
1830
- availableTargetLangs
1831
- availableCompilerVersions= {ready. versions}
1832
- selectedTargetLang
1833
- loadedLibraries= {ready. selected. libraries}
1834
- onCompilerSelect
1835
- onTargetLangSelect
1836
- onCompileClick
1837
- onFormatClick
1838
- />
1839
- </>;
1840
- | Init => "Initializing" -> s
1841
- | SetupFailed (msg ) => <> {("Setup failed: " ++ msg)-> s} </>
1842
- };
1843
-
1844
1774
<>
1845
1775
<Meta
1846
1776
title= "ReScript Playground"
0 commit comments