ui: redesign room cards - sensor data prominent
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

- Temp/humidity now large and center with colored icons
- Size and capacity compressed to header subtitle
- Batch count with status indicator dot
- Cleaner visual hierarchy
This commit is contained in:
fullsizemalt 2025-12-12 19:13:00 -08:00
parent e7be23cce4
commit 3239a8b89b

View file

@ -88,49 +88,53 @@ export default function RoomsPage() {
key={room.id} key={room.id}
className="card card-interactive p-4 group" className="card card-interactive p-4 group"
> >
{/* Header: Name + Type Badge */}
<div className="flex justify-between items-start mb-4"> <div className="flex justify-between items-start mb-4">
<div>
<h3 className="font-medium text-primary text-sm"> <h3 className="font-medium text-primary text-sm">
{room.name?.replace('[DEMO] ', '')} {room.name?.replace('[DEMO] ', '')}
</h3> </h3>
<span className="text-xs text-tertiary">{room.sqft?.toLocaleString()} sqft {room.capacity || '—'} cap</span>
</div>
<span className={getBadgeClass(room.type)}> <span className={getBadgeClass(room.type)}>
{room.type} {room.type}
</span> </span>
</div> </div>
<div className="space-y-2 text-sm"> {/* Primary: Sensor Data - Large & Prominent */}
<div className="flex justify-between"> <div className="flex items-center justify-around py-4 border-y border-subtle mb-4">
<span className="text-tertiary">Size</span> <div className="text-center">
<span className="text-primary font-medium"> <div className="flex items-center justify-center gap-1 text-2xl font-semibold text-primary">
{room.sqft?.toLocaleString()} sqft <Thermometer size={18} className="text-red-500" />
</span> {room.targetTemp || '—'}
<span className="text-sm text-tertiary font-normal">°F</span>
</div> </div>
<div className="flex justify-between"> <span className="text-[10px] text-tertiary uppercase tracking-wide">Temp</span>
<span className="text-tertiary">Capacity</span>
<span className="text-primary font-medium">
{room.capacity || '—'} plants
</span>
</div> </div>
<div className="flex justify-between"> <div className="w-px h-10 bg-subtle" />
<span className="text-tertiary">Active Batches</span> <div className="text-center">
<span className="text-accent font-medium"> <div className="flex items-center justify-center gap-1 text-2xl font-semibold text-primary">
{room.batches?.length || 0} <Droplets size={18} className="text-blue-500" />
</span> {room.targetHumidity || '—'}
<span className="text-sm text-tertiary font-normal">%</span>
</div>
<span className="text-[10px] text-tertiary uppercase tracking-wide">Humidity</span>
</div> </div>
</div> </div>
{room.targetTemp && ( {/* Secondary: Batch Count */}
<div className="mt-4 pt-3 border-t border-subtle flex gap-4 text-xs text-tertiary"> <div className="flex items-center justify-between">
<div className="flex items-center gap-1"> <div className="flex items-center gap-2">
<Thermometer size={12} /> <div className={`w-2 h-2 rounded-full ${room.batches?.length > 0 ? 'bg-success' : 'bg-subtle'}`} />
{room.targetTemp}°F <span className="text-sm font-medium text-primary">
</div> {room.batches?.length || 0} {room.batches?.length === 1 ? 'batch' : 'batches'}
<div className="flex items-center gap-1"> </span>
<Droplets size={12} />
{room.targetHumidity}%
</div>
</div> </div>
{room.batches?.length > 0 && (
<span className="text-xs text-accent">View </span>
)} )}
</div> </div>
</div>
))} ))}
</div> </div>
)} )}