Refactor
This commit is contained in:
16
src/app/(admin)/admin/_components/dashboard-title.tsx
Normal file
16
src/app/(admin)/admin/_components/dashboard-title.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user