17 lines
491 B
TypeScript
17 lines
491 B
TypeScript
type DashBoardTitleProps = {
|
|
renderSubtitle: true
|
|
subtitle: string
|
|
} | {
|
|
renderSubtitle?: false
|
|
subtitle?: never
|
|
}
|
|
|
|
export default function DashBoardTitle({ title, subtitle, renderSubtitle }: DashBoardTitleProps & { title: string }) {
|
|
return (
|
|
<div className="pb-6">
|
|
<h1 className="mb-2 text-2xl font-bold text-foreground">{title}</h1>
|
|
{renderSubtitle && <p className="text-sm text-muted-foreground">{subtitle}</p>}
|
|
</div>
|
|
)
|
|
}
|