Open History to see the last commit
1import type { ComponentPropsWithoutRef } from "react";
2
3import { cn } from "../lib/utils";
4import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../workspaceTitlebar";
5
6/** Shared workspace top-bar geometry. */
7export function WorkspacePageHeader({
8 electron = false,
9 reserveNativeControls = electron,
10 className,
11 ...props
12}: ComponentPropsWithoutRef<"header"> & {
13 readonly electron?: boolean;
14 readonly reserveNativeControls?: boolean;
15}) {
16 return (
17 <header
18 className={cn(
19 "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-3 pl-(--workspace-gutter-start) pr-(--workspace-gutter-end) [[data-panel-animations=true]_&]:motion-safe:transition-[padding-left,padding-right] [[data-panel-animations=true]_&]:motion-safe:duration-(--panel-animation-duration) [[data-panel-animations=true]_&]:motion-safe:ease-out",
20 electron && "drag-region",
21 reserveNativeControls && "wco:pr-(--workspace-native-controls-inset)",
22 COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
23 className,
24 )}
25 {...props}
26 />
27 );
28}