Skip to content

Commit ea6e7d3

Browse files
committed
refactor(web): inline pause confirmation into header action buttons
1 parent fea368d commit ea6e7d3

2 files changed

Lines changed: 26 additions & 34 deletions

File tree

apps/web/src/app/platform/streams/[id]/stream-detail-client.tsx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,32 @@ export function StreamDetailClient({
160160
</div>
161161
<div className="dash-actions">
162162
{stream.status === "active" && (
163-
<button
164-
className="dash-btn"
165-
disabled={pausing === "loading"}
166-
onClick={() => setPausing("confirm")}
167-
>
168-
<span className="btn-icon">
169-
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><rect x="4" y="3" width="3" height="10" rx="0.5"/><rect x="9" y="3" width="3" height="10" rx="0.5"/></svg>
170-
</span>
171-
Pause
172-
</button>
163+
pausing !== "idle" ? (
164+
<>
165+
<button
166+
className="dash-btn danger"
167+
onClick={handlePause}
168+
>
169+
{pausing === "loading" ? "Pausing..." : "Pause"}
170+
</button>
171+
<button
172+
className="dash-btn"
173+
onClick={() => setPausing("idle")}
174+
>
175+
Cancel
176+
</button>
177+
</>
178+
) : (
179+
<button
180+
className="dash-btn"
181+
onClick={() => setPausing("confirm")}
182+
>
183+
<span className="btn-icon">
184+
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><rect x="4" y="3" width="3" height="10" rx="0.5"/><rect x="9" y="3" width="3" height="10" rx="0.5"/></svg>
185+
</span>
186+
Pause
187+
</button>
188+
)
173189
)}
174190
{(stream.status === "paused" || stream.status === "inactive") && (
175191
<button
@@ -208,21 +224,6 @@ export function StreamDetailClient({
208224
</div>
209225
</div>
210226

211-
{/* Pause confirmation */}
212-
{pausing === "confirm" && (
213-
<div className="dash-confirm-inline">
214-
<span>Pause this stream? Events will be buffered until resumed.</span>
215-
<div style={{ display: "flex", gap: 8 }}>
216-
<button className="dash-btn danger" style={{ fontSize: 12, padding: "4px 12px" }} onClick={handlePause}>
217-
Pause
218-
</button>
219-
<button className="dash-btn" style={{ fontSize: 12, padding: "4px 12px" }} onClick={() => setPausing("idle")}>
220-
Cancel
221-
</button>
222-
</div>
223-
</div>
224-
)}
225-
226227
{/* Stats */}
227228
<div className="dash-stats">
228229
<div className="dash-stat">

apps/web/src/styles/console.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -913,15 +913,6 @@
913913
}
914914

915915
/* ── Status bar ──────────────────────────────────────────────── */
916-
.dash-confirm-inline {
917-
display: flex;
918-
align-items: center;
919-
justify-content: space-between;
920-
gap: 12px;
921-
font-size: 13px;
922-
color: var(--text-muted);
923-
margin-bottom: 24px;
924-
}
925916

926917
/* ── Stream list inline actions ──────────────────────────────── */
927918
.stream-row {

0 commit comments

Comments
 (0)