
This is a rather large commit that includes all of the following: - React UI with code editor, runtime renderer and input-output panes - Language providers for a sample language and Brainfuck - Implementation of code execution in a web worker - All-at-once unabortable execution of program fully functional
25 lines
487 B
TypeScript
25 lines
487 B
TypeScript
import { RendererProps } from "../types";
|
|
import { RS } from "./constants";
|
|
|
|
const styles = {
|
|
container: {
|
|
width: "100%",
|
|
height: "100%",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
},
|
|
text: {
|
|
fontSize: "4em",
|
|
},
|
|
};
|
|
|
|
export const Renderer = ({ state }: RendererProps<RS>) => {
|
|
const value = state == null ? 0 : state.value;
|
|
return (
|
|
<div style={styles.container}>
|
|
<h1 style={styles.text}>{value}</h1>
|
|
</div>
|
|
);
|
|
};
|