Move to Typescript.

This commit is contained in:
Manuel Friedli 2023-04-17 02:43:36 +02:00
parent 34618860a4
commit ac964ddd3f
16 changed files with 482 additions and 119 deletions

View file

@ -1,23 +0,0 @@
import React from 'react';
import Cell from "./Cell";
export default function Maze({state, dispatch}) {
if (!state.maze) {
return <div>No valid maze.</div>
}
let maze = [];
for (let y = 0; y < state.maze.height; y++) {
let row = [];
for (let x = 0; x < state.maze.width; x++) {
row.push(<Cell key={`${x}x${y}`} x={x} y={y} state={state} dispatch={dispatch}/>)
}
maze.push(<div key={`r${y}`} className={"row"}>{row}</div>);
}
return (
<div className={"maze"}>
{maze}
</div>
);
}