Fix linting and build errors.
This commit is contained in:
parent
d8d05589e7
commit
36e1ea45d5
9 changed files with 94 additions and 45 deletions
|
|
@ -1,14 +1,21 @@
|
|||
import Cell from "./cell.tsx";
|
||||
import styles from "./maze.module.css";
|
||||
import {State} from "@/app/state/state.ts";
|
||||
import {ActionDispatch, JSX} from "react";
|
||||
import {Action} from "@/app/state/action.ts";
|
||||
|
||||
export default function Maze({state, dispatch}) {
|
||||
export default function Maze({state, dispatch}:
|
||||
{
|
||||
state: State,
|
||||
dispatch: ActionDispatch<[Action]>
|
||||
}) {
|
||||
if (!state.maze) {
|
||||
return <div>No valid maze.</div>
|
||||
}
|
||||
|
||||
let maze: JSX.Element[] = [];
|
||||
const maze: JSX.Element[] = [];
|
||||
for (let y = 0; y < state.maze.height; y++) {
|
||||
let row: JSX.Element[] = [];
|
||||
const row: JSX.Element[] = [];
|
||||
for (let x = 0; x < state.maze.width; x++) {
|
||||
row.push(<Cell key={`${x}x${y}`} x={x} y={y} state={state} dispatch={dispatch}/>)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue