import React from 'react';
export default function GameGrid({ grid, width, middle }) {
return (
{grid.map((row, rowIndex) => (
{Array.from({ length: width + 1 }, (_, colIndex) => {
const start = middle - row.pos;
const charIndex = colIndex - start;
const name = row.actorName;
const isInRange = charIndex >= 0 && charIndex < name.length;
const isHighlighted = charIndex === row.pos;
return (
|
{isInRange ? name[charIndex].toUpperCase() : ''}
|
);
})}
))}
);
}