import React from 'react'; // Fix #4: Memoized grid cell — only re-renders when its own visual state changes const GridCell = React.memo(({ cellClass, isObstacle, isHighCost, isStart, isEnd, tooltipContent }) => { const inner = (
{isObstacle && !isStart && !isEnd && (
)} {isHighCost && !isStart && !isEnd && (
)}
); if (!tooltipContent) return inner; return (
{inner}
{tooltipContent}
); }); GridCell.displayName = 'GridCell'; export default GridCell;