mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 00:52:17 +03:00
Fix ability to specify if card is using heading
This commit is contained in:
@@ -8,6 +8,7 @@ type EmptyCardProps = {
|
||||
className?: string;
|
||||
icon: React.ReactNode;
|
||||
title: string;
|
||||
titleHeading?: boolean;
|
||||
description?: string;
|
||||
buttonText?: string;
|
||||
link?: string;
|
||||
@@ -16,14 +17,23 @@ export function EmptyCard({
|
||||
className,
|
||||
icon,
|
||||
title,
|
||||
titleHeading = true,
|
||||
description,
|
||||
buttonText,
|
||||
link,
|
||||
}: EmptyCardProps) {
|
||||
let TitleComponent;
|
||||
|
||||
if (titleHeading) {
|
||||
TitleComponent = <Heading as="h4">{title}</Heading>;
|
||||
} else {
|
||||
TitleComponent = <div>{title}</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn("flex flex-col items-center gap-2", className)}>
|
||||
{icon}
|
||||
<Heading as="h4">{title}</Heading>
|
||||
{TitleComponent}
|
||||
{description && (
|
||||
<div className="mb-3 text-secondary-foreground">{description}</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user