import React from "react"; import styled from "styled-components"; const Row = styled.div.attrs(({ theme, zoom }) => ({ style: { height: theme.snake.cell.size * (zoom || 1) + "rem" } }))` white-space: nowrap; `; const Cell = styled.div.attrs(({ theme, zoom }) => ({ style: { height: theme.snake.cell.size * (zoom || 1) + "rem", width: theme.snake.cell.size * (zoom || 1) + "rem", border: theme.snake.cell.border } }))` display: inline-block; vertical-align: top; text-align: center; box-shadow: ${({ theme }) => theme.stage.cell.boxShadow}; `; export const Stage = ({ data, children, zoom = 1 }) => (
{data.map((r, y) => ( {r.map((c, x) => ( {children(c, zoom)} ))} ))}
); export default Stage;