Elffuss BraidHub

kikocis/continue public

ccbc6f34a529 · 1.1 KiBRawPermalink
1import { ArrowLeftIcon } from "@heroicons/react/24/outline";
2import { fontSize } from "../util";
3
4export interface PageHeaderProps {
5 onTitleClick?: () => void;
6 title?: string;
7 rightContent?: React.ReactNode;
8 showBorder?: boolean;
9}
10
11export function PageHeader({
12 onTitleClick,
13 title,
14 rightContent,
15 showBorder,
16}: PageHeaderProps) {
17 return (
18 <div
19 className={`bg-vsc-background sticky top-0 z-20 m-0 flex items-center justify-between bg-inherit ${
20 showBorder
21 ? "border-0 border-b-[1px] border-solid border-b-zinc-700"
22 : ""
23 }`}
24 >
25 {title ? (
26 <div
27 className="flex cursor-pointer items-center transition-colors duration-200 hover:text-zinc-100"
28 onClick={onTitleClick}
29 >
30 <ArrowLeftIcon className="ml-3 inline-block h-3 w-3" />
31 <span
32 className="mx-2 inline-block text-base font-bold"
33 style={{
34 fontSize: fontSize(-2),
35 }}
36 >
37 {title}
38 </span>
39 </div>
40 ) : (
41 <div />
42 )}
43
44 {rightContent && <div className="pr-2">{rightContent}</div>}
45 </div>
46 );
47}