import React from 'react';
const LIVE = new Set(['ready', 'scanning']);
const WARN = new Set(['connected', 'pairing', 'calibrating', 'processing', 'kinect_detected', 'warning']);
export default function StatusPill({ label, state = 'offline' }) {
  const tone = LIVE.has(state) ? 'live' : WARN.has(state) ? 'warn' : 'danger';
  const dot = { live: 'bg-[#7dff72] shadow-[0_0_8px_#7dff72]', warn: 'bg-amber-400 shadow-[0_0_8px_#fbbf24]', danger: 'bg-red-500 shadow-[0_0_8px_#ef4444]' }[tone];
  const text = { live: 'text-zinc-200', warn: 'text-amber-200', danger: 'text-red-200' }[tone];
  return <div className={`flex items-center gap-2 rounded-full border border-white/10 bg-white/[.03] px-3 py-1.5 text-xs ${text}`}><span className={`h-2 w-2 rounded-full ${dot}`}/><span>{label}</span></div>;
}