diff --git a/src/App.tsx b/src/App.tsx index d3da71d..7dd16c7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -45,6 +45,9 @@ function App() { onAddClick={() => { setPage('add-dsp'); }} + + onConnect={dsp408.connectDSP} + onDisconnect={dsp408.disconnectDSP} />
diff --git a/src/components/topbar/Topbar.css b/src/components/topbar/Topbar.css index bd5f3da..6e23dc9 100644 --- a/src/components/topbar/Topbar.css +++ b/src/components/topbar/Topbar.css @@ -176,6 +176,8 @@ min-height: 0; min-width: 0; + + border-radius: var(--radius-sm); } .tab-close { diff --git a/src/components/topbar/Topbar.tsx b/src/components/topbar/Topbar.tsx index 220ffae..8fea3f6 100644 --- a/src/components/topbar/Topbar.tsx +++ b/src/components/topbar/Topbar.tsx @@ -22,6 +22,8 @@ function Tab({ step, onSelect, onRemove, + onConnect, + onDisconnect, }: { dsp: DSP; active: boolean; @@ -29,25 +31,71 @@ function Tab({ step: number; onSelect: () => void; onRemove: () => void; + onConnect: (dsp: DSP) => void; + onDisconnect: (dsp: DSP) => void; }) { + const handleLedClick = (e: React.MouseEvent) => { + e.stopPropagation(); + + if (dsp.status === 'connected') { + onDisconnect(dsp); + } else { + onConnect(dsp); + } + }; + return (