Files
jiang13-bbs/frontend/components/admin/AdminPageHeader.tsx

40 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { LucideIcon } from "lucide-react";
import type { ReactNode } from "react";
/** 后台统一页头:36px 图标槽 + 标题 + 说明 + 可选右侧 CTA */
export default function AdminPageHeader({
icon: Icon,
title,
description,
actions,
}: {
icon: LucideIcon;
title: string;
description?: ReactNode;
actions?: ReactNode;
}) {
return (
<div className="mb-5 flex items-start justify-between gap-3 flex-wrap">
<div className="min-w-0">
<h1
className="text-[22px] sm:text-[26px] font-extrabold tracking-tight flex items-center gap-2.5"
style={{ color: "var(--ink)" }}
>
<span
className="w-9 h-9 rounded-xl flex items-center justify-center shrink-0"
style={{ background: "var(--accent-soft)", color: "var(--accent)" }}
aria-hidden
>
<Icon size={18} />
</span>
{title}
</h1>
{description != null && description !== "" && (
<p className="meta mt-1.5 text-[12.5px] leading-relaxed">{description}</p>
)}
</div>
{actions ? <div className="flex items-center gap-2 shrink-0 flex-wrap">{actions}</div> : null}
</div>
);
}