// module.exports = function getDefaultTextForLanguage(language) {
export function getDefaultTextForLanguage(language) {
  switch (language) {
    case 'javascript':
      return javascriptDefaultText;
    case 'js':
      return javascriptDefaultText;
    case 'css':
      return cssDefaultText;
    case 'html':
      return htmlDefaultText;
    default:
      return htmlDefaultText;
  }
// };
}

const javascriptDefaultText =
  `function helloWorld(){
    console.log('hello world!');
  }
  helloWorld();
 `
;

const htmlDefaultText = `<!DOCTYPE html>
<html style="height:100%">
<head>
  <script type="text/javascript">
    let receivedCall = null;
    window.load = function (js, css) {
      receivedCall = {
        js: js,
        css: css
      };
    };
  </script>
</head>
<body>
<script type="text/javascript">
  let geval = eval;
  window.load = function (js, css) {
    if (css) {
      const style = document.createElement("style");
      style.type = "text/css";
      style.innerHTML = css;
      document.body.appendChild(style);
    }

    if (js) {
      try {
        geval(js);
      } catch (error) {
        console.log(error);
      }
    }
  };
  if (receivedCall) {
    window.load(receivedCall.js, receivedCall.css);
  }
</script>
</body>
</html>
`;

const cssDefaultText =
  `html, body{
   height: 100%;
  }
  `;

@@ -114,16 +114,18 @@
 uage) %7B%0A
+  
   switch
@@ -138,24 +138,28 @@
 uage) %7B%0A    
+    
 case 'javasc
@@ -163,32 +163,38 @@
 ascript':%0A      
+      
 return javascrip
@@ -199,32 +199,36 @@
 iptDefaultText;%0A
+    
     case 'js':%0A 
@@ -228,24 +228,30 @@
 'js':%0A      
+      
 return javas
@@ -268,24 +268,28 @@
 ltText;%0A    
+    
 case 'css':%0A
@@ -284,24 +284,30 @@
 case 'css':%0A
+      
       return
@@ -323,24 +323,28 @@
 ltText;%0A    
+    
 case 'html':
@@ -342,32 +342,38 @@
 e 'html':%0A      
+      
 return htmlDefau
@@ -376,24 +376,28 @@
 efaultText;%0A
+    
     default:
@@ -399,24 +399,30 @@
 ault:%0A      
+      
 return htmlD
@@ -433,16 +433,18 @@
 ltText;%0A
+  
   %7D%0A// %7D
@@ -484,36 +484,137 @@
 =%0A  
-%60function helloWorld()%7B%0A    
+  %60const X = (props)=%3E%3Cdiv%3E%3Cspan%3E%7Bprops.val%7D%3C/span%3E%3Cbutton onClick=%7Bprops.onClick%7D%3Eclick here%3C/button%3E%3C/div%3E;%0Aconst onClick= e=%3E%7B
 cons
@@ -626,43 +626,109 @@
 og('
-hello world!
+click
 ')
+%7D
 ;%0A
-  %7D%0A  helloWorld(
+ReactDOM.render(%3CX val=%22hi there!%22 onClick=%7BonClick%7D /%3E, document.querySelector(%22#root%22)
 );
+ 
 %0A %60%0A
@@ -803,681 +803,279 @@
 %22%3E%0A%3C
-head%3E%0A  %3Cscript type=%22text/javascript%22%3E%0A    let receivedCall = null;%0A    window.load = function (js, css) %7B%0A      receivedCall = %7B%0A        js: js,%0A        css: css%0A      %7D;%0A    %7D;%0A  %3C/script%3E%0A%3C/head%3E%0A%3Cbody%3E%0A%3Cscript type=%22text/javascript%22%3E%0A  let geval = eval;%0A  window.load = function (js, css) %7B%0A    if (css) %7B%0A      const style = document.createElement(%22style%22);%0A      style.type = %22text/css%22;%0A      style.innerHTML = css;%0A      document.body.appendChild(style);%0A    %7D%0A%0A    if (js) %7B%0A      try %7B%0A        geval(js);%0A      %7D catch (error) %7B%0A        console.log(error);%0A      %7D%0A    %7D%0A  %7D;%0A  if (receivedCall) %7B%0A    window.load(receivedCall.js, receivedCall.css);%0A  %7D%0A%3C/script
+!DOCTYPE html%3E%0A%3Chtml style=%22height:100%25%22%3E%0A%3Chead%3E%0A%3Cscript crossorigin src=%22https://unpkg.com/react@16/umd/react.development.js%22%3E%3C/script%3E%0A%3Cscript crossorigin src=%22https://unpkg.com/react-dom@16/umd/react-dom.development.js%22%3E%3C/script%3E%0A%3C/head%3E%0A%3Cbody%3E%0A  %3Cdiv id =%22root%22%3E%3C/div
 %3E%0A%3C/
@@ -1115,16 +1115,18 @@
 tText =%0A
+  
   %60html,
@@ -1153,13 +1153,43 @@
 0%25;%0A  %7D%0A
+  span %7B%0A    color: blue;%0A  %7D%0A
   %60;%0A

replace js example with a React one