labyrinth-frontend/src/Cell.js

15 lines
479 B
JavaScript
Raw Normal View History

2023-04-14 02:01:55 +02:00
import React from 'react';
export default function Cell({spec, rowIndex, cellIndex, showSolution}) {
2023-04-14 02:01:55 +02:00
let classes = "cell r" + rowIndex + " c" + cellIndex;
if (spec.top) classes += " top";
if (spec.right) classes += " right";
if (spec.bottom) classes += " bottom";
if (spec.left) classes += " left";
if (spec.solution && showSolution) classes += " solution";
2023-04-14 02:01:55 +02:00
if (spec.user) classes += " user";
return (
<div className={classes}/>
2023-04-14 02:01:55 +02:00
);
}