refactor: enhance peripheral display to support multiple types and improve readability

This commit is contained in:
MayaTheShy
2026-02-20 03:53:49 -05:00
parent 53ae92a184
commit 2686ca4697

View File

@@ -234,10 +234,12 @@ function TurtleDetails({ turtle }) {
<div className="detail-section">
<h3>Peripherals</h3>
<div className="status-grid">
{Object.entries(turtle.peripherals).map(([side, type]) => (
{Object.entries(turtle.peripherals).map(([side, info]) => (
<div key={side} className="status-item">
<span className="label" style={{ textTransform: 'capitalize' }}>{side}:</span>
<span className="value" style={{ color: '#ff55ff' }}>{type}</span>
<span className="value" style={{ color: '#ff55ff' }}>
{typeof info === 'string' ? info : (info?.types?.join(', ') || 'unknown')}
</span>
</div>
))}
</div>