forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageHeader.tsx
More file actions
38 lines (33 loc) · 1002 Bytes
/
Copy pathPageHeader.tsx
File metadata and controls
38 lines (33 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use client';
import { ArrowLeft, LucideIcon } from 'lucide-react';
import { useRouter } from '@tschk/moonshine-next/navigation';
interface PageHeaderProps {
title: string;
icon?: LucideIcon;
showBackButton?: boolean;
onBack?: () => void;
}
export function PageHeader({ title, icon: Icon, showBackButton, onBack }: PageHeaderProps) {
const router = useRouter();
const handleBack = () => {
if (onBack) {
onBack();
} else {
router.back();
}
};
return (
<div className="flex items-center gap-3 px-6 py-4 border-b border-bg-tertiary bg-bg-secondary">
{showBackButton && (
<button
onClick={handleBack}
className="p-2 rounded-lg hover:bg-bg-tertiary transition-colors"
>
<ArrowLeft className="w-5 h-5 text-text-secondary" />
</button>
)}
{Icon && <Icon className="w-6 h-6 text-text-secondary" />}
<h1 className="text-2xl font-bold text-text-primary">{title}</h1>
</div>
);
}