File size: 1,583 Bytes
b032b2d
 
 
83fe4f9
b032b2d
 
 
 
83fe4f9
b032b2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83fe4f9
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export function DashboardScreen({ stats }) {
  const metricLine = `${stats.executionsToday} runs today`;
  const isLive = stats.activeWorkflows > 0;
  return `
    <section class="screen-card dashboard-card">
      <div class="screen-intro">
        <p class="step-label">Live operations</p>
        <h2>${isLive ? "Your inbox operator is live" : "Automation is stopped"}</h2>
      </div>
      <div class="dashboard-hero">
        <div>
          <p class="dashboard-kicker">Today</p>
          <p class="dashboard-metric">${metricLine}</p>
        </div>
        <span class="topbar-status ${isLive ? "status-success" : "status-warning"}">
          <span class="status-dot"></span>
          <span>${isLive ? "Stable" : "Stopped"}</span>
        </span>
      </div>
      <div class="dashboard-stats">
        <div class="stat-card">
          <span>Active workflows</span>
          <strong>${stats.activeWorkflows}</strong>
        </div>
        <div class="stat-card">
          <span>Pending escalations</span>
          <strong>${stats.pendingEscalations}</strong>
        </div>
        <div class="stat-card">
          <span>Runs completed</span>
          <strong>${stats.executionsToday}</strong>
        </div>
      </div>
      <div class="button-row split-actions compact-actions">
        ${stats.pendingEscalations ? `<button id="flowpilot-open-escalation" class="secondary-button">Open escalation</button>` : ""}
        ${isLive ? `<button id="flowpilot-stop-automation" class="ghost-button">Stop automation</button>` : ""}
      </div>
    </section>
  `;
}