fix: connection led
This commit is contained in:
@@ -14,20 +14,14 @@ function ConnectionPanel({
|
|||||||
onConnect: () => void;
|
onConnect: () => void;
|
||||||
onDisconnect: () => void;
|
onDisconnect: () => void;
|
||||||
}) {
|
}) {
|
||||||
const statusLabel =
|
|
||||||
isConnected(dsp)
|
|
||||||
? 'Connected'
|
|
||||||
: dsp.isConnecting
|
|
||||||
? 'Connecting…'
|
|
||||||
: 'Disconnected';
|
|
||||||
|
|
||||||
console.log('ConnectionPanel render:', {
|
|
||||||
id: dsp.id,
|
|
||||||
connection: dsp.type === 'DSP408' ? dsp.state.connection : undefined,
|
|
||||||
isConnected: isConnected(dsp),
|
|
||||||
isConnecting: dsp.isConnecting,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const statusLabel =
|
||||||
|
isConnected(dsp)
|
||||||
|
? 'Connected'
|
||||||
|
: dsp.isConnecting
|
||||||
|
? 'Connecting…'
|
||||||
|
: 'Disconnected';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="connection-section">
|
<div className="connection-section">
|
||||||
<Card className="connection-panel">
|
<Card className="connection-panel">
|
||||||
@@ -42,10 +36,10 @@ function ConnectionPanel({
|
|||||||
|
|
||||||
<div className="connection-panel__status">
|
<div className="connection-panel__status">
|
||||||
<span className="connection-panel__led">
|
<span className="connection-panel__led">
|
||||||
{/* <Led status={dsp.status} /> */}
|
<Led status={dsp.isConnecting ? "connecting" : isConnected(dsp) ? "connected" : "disconnected"} />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{/* <span className={`status-label status-label--${dsp.status}`}>{statusLabel}</span> */}
|
<span>{statusLabel}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -247,13 +247,13 @@ export type DSPState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export enum ConnectionStatus {
|
export enum ConnectionStatus {
|
||||||
Connected,
|
Connected = 'Connected',
|
||||||
Disconnected,
|
Disconnected = 'Disconnected',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DSPMode {
|
export enum DSPMode {
|
||||||
Demo,
|
Demo = 'Demo',
|
||||||
Normal,
|
Normal = 'Normal',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DSP408Snapshot = {
|
export type DSP408Snapshot = {
|
||||||
|
|||||||
Reference in New Issue
Block a user