23 lines
524 B
TypeScript
23 lines
524 B
TypeScript
import { PropsWithChildren, ReactNode } from "react";
|
|
|
|
type PanelProps = PropsWithChildren<{
|
|
title: string;
|
|
subtitle?: string;
|
|
actions?: ReactNode;
|
|
}>;
|
|
|
|
export default function Panel({ title, subtitle, actions, children }: PanelProps) {
|
|
return (
|
|
<section className="panel">
|
|
<header className="panel__header">
|
|
<div>
|
|
<p className="eyebrow">{title}</p>
|
|
{subtitle ? <h2>{subtitle}</h2> : null}
|
|
</div>
|
|
{actions}
|
|
</header>
|
|
{children}
|
|
</section>
|
|
);
|
|
}
|