mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-12 00:05:09 +00:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
// Shared page header. Every page slots its title + tagline + optional
|
|
// actions in here so the spacing/typography stays consistent.
|
|
|
|
import type { ReactNode } from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface PageHeaderProps {
|
|
title: string;
|
|
description?: string;
|
|
children?: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export function PageHeader({ title, description, children, className }: PageHeaderProps) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"mb-6 flex flex-col gap-2 md:flex-row md:items-end md:justify-between",
|
|
className,
|
|
)}
|
|
>
|
|
<div className="min-w-0">
|
|
<h1 className="text-2xl font-semibold tracking-tight text-foreground">
|
|
{title}
|
|
</h1>
|
|
{description && (
|
|
<p className="text-sm text-muted-foreground mt-1 max-w-2xl">
|
|
{description}
|
|
</p>
|
|
)}
|
|
</div>
|
|
{children && <div className="flex flex-wrap items-center gap-2">{children}</div>}
|
|
</div>
|
|
);
|
|
}
|