MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / StudioHeader

Function StudioHeader

packages/studio/src/components/StudioHeader.tsx:184–325  ·  view source on GitHub ↗
({
  captureFrameHref,
  captureFrameFilename,
  handleCaptureFrameClick,
  refreshCaptureFrameTime,
  inspectorButtonActive,
  inspectorPanelActive,
  onExport,
}: StudioHeaderProps)

Source from the content-addressed store, hash-verified

182
183// fallow-ignore-next-line complexity
184export function StudioHeader({
185 captureFrameHref,
186 captureFrameFilename,
187 handleCaptureFrameClick,
188 refreshCaptureFrameTime,
189 inspectorButtonActive,
190 inspectorPanelActive,
191 onExport,
192}: StudioHeaderProps) {
193 const { projectId, editHistory, handleUndo, handleRedo } = useStudioShellContext();
194 const { rightCollapsed, setRightCollapsed, setRightPanelTab } = usePanelLayoutContext();
195
196 return (
197 <div className="flex items-center justify-between h-10 px-3 bg-neutral-900 border-b border-neutral-800 flex-shrink-0">
198 {/* Left: logo + project name */}
199 <div className="flex items-center gap-3">
200 <HyperframesLogo />
201 <span className="text-neutral-700 select-none" aria-hidden="true">
202 |
203 </span>
204 <span className="text-[11px] font-medium text-neutral-300">{projectId}</span>
205 </div>
206 {/* Center: storyboard / preview toggle */}
207 <ViewModeToggle />
208 {/* Right: toolbar buttons */}
209 <div className="flex items-center gap-1.5">
210 <button
211 type="button"
212 onClick={() => {
213 trackStudioEvent("toolbar_action", { action: "undo" });
214 void handleUndo();
215 }}
216 disabled={!editHistory.canUndo}
217 className={`h-7 w-7 flex items-center justify-center rounded-md transition-colors ${
218 editHistory.canUndo
219 ? "text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"
220 : "text-neutral-700 cursor-default"
221 }`}
222 title={
223 editHistory.undoLabel
224 ? `Undo ${editHistory.undoLabel} (${getHistoryShortcutLabel("undo")})`
225 : `Undo (${getHistoryShortcutLabel("undo")})`
226 }
227 aria-label="Undo"
228 >
229 <RotateCcw size={14} />
230 </button>
231 <button
232 type="button"
233 onClick={() => {
234 trackStudioEvent("toolbar_action", { action: "redo" });
235 void handleRedo();
236 }}
237 disabled={!editHistory.canRedo}
238 className={`h-7 w-7 flex items-center justify-center rounded-md transition-colors ${
239 editHistory.canRedo
240 ? "text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"
241 : "text-neutral-700 cursor-default"

Callers

nothing calls this directly

Calls 4

useStudioShellContextFunction · 0.90
usePanelLayoutContextFunction · 0.90
trackStudioEventFunction · 0.90
getHistoryShortcutLabelFunction · 0.90

Tested by

no test coverage detected