Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

WorkspacePageHeader.tsx

27 lines1.1 KB

1import type { ComponentPropsWithoutRef } from "react";
2​
3import { cn } from "../lib/utils";
4import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../workspaceTitlebar";
5​
6export function WorkspacePageHeader({
7 electron = false,
8 reserveNativeControls = electron,
9 className,
10 ...props
11}: ComponentPropsWithoutRef<"header"> & {
12 readonly electron?: boolean;
13 readonly reserveNativeControls?: boolean;
14}) {
15 return (
16 <header
17 className={cn(
18 "flex h-[var(--workspace-topbar-height)]! min-h-[var(--workspace-topbar-height)]! max-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",
19 electron && "drag-region",
20 reserveNativeControls && "wco:pr-(--workspace-native-controls-inset)",
21 COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
22 className,
23 )}
24 {...props}
25 />
26 );