|
| 1 | +import type React from "react"; |
| 2 | +import { colors, fonts } from "./styles"; |
| 3 | + |
| 4 | +const sidebarItems = [ |
| 5 | + { icon: "~", label: "Dashboard", active: false }, |
| 6 | + { icon: ">", label: "Events", active: true }, |
| 7 | + { icon: "#", label: "Projections", active: false }, |
| 8 | + { icon: "*", label: "Schemas", active: false }, |
| 9 | + { icon: "!", label: "Pipelines", active: false }, |
| 10 | + { icon: "@", label: "Settings", active: false }, |
| 11 | +]; |
| 12 | + |
| 13 | +interface Props { |
| 14 | + children: React.ReactNode; |
| 15 | + title?: string; |
| 16 | +} |
| 17 | + |
| 18 | +export const MockDashboard: React.FC<Props> = ({ children, title = "Event Explorer" }) => ( |
| 19 | + <div |
| 20 | + style={{ |
| 21 | + display: "flex", |
| 22 | + width: "100%", |
| 23 | + height: "100%", |
| 24 | + background: colors.bg, |
| 25 | + fontFamily: fonts.sans, |
| 26 | + color: colors.text, |
| 27 | + }} |
| 28 | + > |
| 29 | + {/* Sidebar */} |
| 30 | + <div |
| 31 | + style={{ |
| 32 | + width: 220, |
| 33 | + background: colors.bgSidebar, |
| 34 | + borderRight: `1px solid ${colors.border}`, |
| 35 | + display: "flex", |
| 36 | + flexDirection: "column", |
| 37 | + padding: "20px 0", |
| 38 | + flexShrink: 0, |
| 39 | + }} |
| 40 | + > |
| 41 | + {/* Logo */} |
| 42 | + <div |
| 43 | + style={{ |
| 44 | + padding: "0 20px 24px", |
| 45 | + display: "flex", |
| 46 | + alignItems: "center", |
| 47 | + gap: 10, |
| 48 | + borderBottom: `1px solid ${colors.border}`, |
| 49 | + marginBottom: 16, |
| 50 | + }} |
| 51 | + > |
| 52 | + <div |
| 53 | + style={{ |
| 54 | + width: 28, |
| 55 | + height: 28, |
| 56 | + borderRadius: 8, |
| 57 | + background: `linear-gradient(135deg, ${colors.primary}, ${colors.cyan})`, |
| 58 | + display: "flex", |
| 59 | + alignItems: "center", |
| 60 | + justifyContent: "center", |
| 61 | + fontSize: 14, |
| 62 | + fontWeight: 800, |
| 63 | + color: "white", |
| 64 | + }} |
| 65 | + > |
| 66 | + A |
| 67 | + </div> |
| 68 | + <span style={{ fontSize: 16, fontWeight: 700, letterSpacing: -0.3 }}>AllSource</span> |
| 69 | + </div> |
| 70 | + |
| 71 | + {/* Nav items */} |
| 72 | + {sidebarItems.map((item) => ( |
| 73 | + <div |
| 74 | + key={item.label} |
| 75 | + style={{ |
| 76 | + padding: "10px 20px", |
| 77 | + display: "flex", |
| 78 | + alignItems: "center", |
| 79 | + gap: 12, |
| 80 | + fontSize: 14, |
| 81 | + fontWeight: item.active ? 600 : 400, |
| 82 | + color: item.active ? colors.text : colors.textMuted, |
| 83 | + background: item.active ? `${colors.primary}15` : "transparent", |
| 84 | + borderLeft: item.active ? `2px solid ${colors.primary}` : "2px solid transparent", |
| 85 | + cursor: "pointer", |
| 86 | + }} |
| 87 | + > |
| 88 | + <span style={{ fontFamily: fonts.mono, fontSize: 14, width: 16 }}>{item.icon}</span> |
| 89 | + {item.label} |
| 90 | + </div> |
| 91 | + ))} |
| 92 | + |
| 93 | + {/* Bottom status */} |
| 94 | + <div style={{ marginTop: "auto", padding: "16px 20px", borderTop: `1px solid ${colors.border}` }}> |
| 95 | + <div style={{ display: "flex", alignItems: "center", gap: 8, fontSize: 12, color: colors.textDim }}> |
| 96 | + <div style={{ width: 8, height: 8, borderRadius: 4, background: colors.green }} /> |
| 97 | + All systems healthy |
| 98 | + </div> |
| 99 | + <div style={{ fontSize: 11, color: colors.textDim, marginTop: 4 }}>v0.19.1 | Pro tier</div> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + |
| 103 | + {/* Main content */} |
| 104 | + <div style={{ flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }}> |
| 105 | + {/* Header */} |
| 106 | + <div |
| 107 | + style={{ |
| 108 | + padding: "16px 28px", |
| 109 | + borderBottom: `1px solid ${colors.border}`, |
| 110 | + display: "flex", |
| 111 | + alignItems: "center", |
| 112 | + justifyContent: "space-between", |
| 113 | + }} |
| 114 | + > |
| 115 | + <h1 style={{ fontSize: 20, fontWeight: 700, margin: 0 }}>{title}</h1> |
| 116 | + <div style={{ display: "flex", alignItems: "center", gap: 12 }}> |
| 117 | + <div |
| 118 | + style={{ |
| 119 | + padding: "6px 14px", |
| 120 | + borderRadius: 8, |
| 121 | + background: colors.bgInput, |
| 122 | + border: `1px solid ${colors.border}`, |
| 123 | + color: colors.textDim, |
| 124 | + fontSize: 13, |
| 125 | + width: 200, |
| 126 | + }} |
| 127 | + > |
| 128 | + Search events... |
| 129 | + </div> |
| 130 | + <div |
| 131 | + style={{ |
| 132 | + width: 32, |
| 133 | + height: 32, |
| 134 | + borderRadius: 16, |
| 135 | + background: `linear-gradient(135deg, ${colors.primary}, ${colors.cyan})`, |
| 136 | + display: "flex", |
| 137 | + alignItems: "center", |
| 138 | + justifyContent: "center", |
| 139 | + fontSize: 13, |
| 140 | + fontWeight: 700, |
| 141 | + color: "white", |
| 142 | + }} |
| 143 | + > |
| 144 | + D |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + </div> |
| 148 | + |
| 149 | + {/* Content */} |
| 150 | + <div style={{ flex: 1, padding: 28, overflow: "hidden" }}>{children}</div> |
| 151 | + </div> |
| 152 | + </div> |
| 153 | +); |
0 commit comments