feat: Update TurtleCard to display turtle label instead of ID

This commit is contained in:
MayaTheShy
2026-02-20 02:34:48 -05:00
parent 2571865917
commit d8f3d5d13c

View File

@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState, useCallback } from 'react';
import { useTurtleStore } from '../store/turtleStore';
import './ControlPanel.css';
@@ -6,6 +6,7 @@ function TurtleCard({ turtle, isSelected, onSelect }) {
const activeState = turtle.state || turtle.mode || 'idle';
const fuel = turtle.fuel === 'unlimited' ? '∞' : (turtle.fuel || '?');
const inventoryCount = turtle.inventory?.length || 0;
const displayName = turtle.label || `Turtle ${turtle.turtleID}`;
const modeColors = {
mining: '#4ade80',
@@ -33,7 +34,7 @@ function TurtleCard({ turtle, isSelected, onSelect }) {
style={{ borderColor: modeColors[activeState] || modeColors.unknown }}
>
<div className="turtle-header">
<h3>Turtle {turtle.turtleID}</h3>
<h3>{displayName}</h3>
<span className="mode-badge" style={{ background: modeColors[activeState] || modeColors.unknown }}>
{activeState}
</span>