/*
Work around to allow for both client and server side rendering.

@copyright (c) Copyright 2013-2017 Dorian Pula
@license AGPL v3
@author Dorian Pula [dorian.pula@amber-penguin-software.ca]
*/

/* eslint-disable */

import {h} from 'preact';  /** @jsx h*/

let CodeMirror;

if (process.env.BROWSER_ENV) {
  require('codemirror/mode/markdown/markdown');
  CodeMirror = require('react-codemirror2');
} else {
  CodeMirror = (props) => {
    return <div>Server side rendering of code editor is unavailable. {props}</div>;
  }
}

export default CodeMirror;
