PageHeader.tsx
949 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
import type { ReactNode } from 'react';
import type { LucideIcon } from 'lucide-react';
import { cn } from '@/lib/utils';
export function PageHeader({
description,
icon: Icon,
actions,
className,
}: {
description?: string;
icon?: LucideIcon;
actions?: ReactNode;
className?: string;
}) {
return (
<div
className={cn(
'flex flex-wrap items-end justify-between gap-4',
className,
)}
>
<div className="flex items-start gap-3">
{Icon && (
<div className="mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary">
<Icon className="h-5 w-5" />
</div>
)}
{description && (
<p className="max-w-2xl text-sm text-muted-foreground">
{description}
</p>
)}
</div>
{actions && <div className="flex items-center gap-2">{actions}</div>}
</div>
);
}