mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-27 14:38:28 +03:00
Fix ability to specify if card is using heading
This commit is contained in:
parent
ba3fc116e0
commit
8a718421ac
@ -8,6 +8,7 @@ type EmptyCardProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
title: string;
|
title: string;
|
||||||
|
titleHeading?: boolean;
|
||||||
description?: string;
|
description?: string;
|
||||||
buttonText?: string;
|
buttonText?: string;
|
||||||
link?: string;
|
link?: string;
|
||||||
@ -16,14 +17,23 @@ export function EmptyCard({
|
|||||||
className,
|
className,
|
||||||
icon,
|
icon,
|
||||||
title,
|
title,
|
||||||
|
titleHeading = true,
|
||||||
description,
|
description,
|
||||||
buttonText,
|
buttonText,
|
||||||
link,
|
link,
|
||||||
}: EmptyCardProps) {
|
}: EmptyCardProps) {
|
||||||
|
let TitleComponent;
|
||||||
|
|
||||||
|
if (titleHeading) {
|
||||||
|
TitleComponent = <Heading as="h4">{title}</Heading>;
|
||||||
|
} else {
|
||||||
|
TitleComponent = <div>{title}</div>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("flex flex-col items-center gap-2", className)}>
|
<div className={cn("flex flex-col items-center gap-2", className)}>
|
||||||
{icon}
|
{icon}
|
||||||
<Heading as="h4">{title}</Heading>
|
{TitleComponent}
|
||||||
{description && (
|
{description && (
|
||||||
<div className="mb-3 text-secondary-foreground">{description}</div>
|
<div className="mb-3 text-secondary-foreground">{description}</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -762,8 +762,9 @@ function DetectionReview({
|
|||||||
|
|
||||||
{!loading && currentItems?.length === 0 && (
|
{!loading && currentItems?.length === 0 && (
|
||||||
<EmptyCard
|
<EmptyCard
|
||||||
className="y-translate-1/2 absolute left-[50%] top-[50%] -translate-x-1/2"
|
className="absolute left-[50%] top-[50%] -translate-x-1/2 -translate-y-1/2 items-center text-center"
|
||||||
title={emptyCardData.title}
|
title={emptyCardData.title}
|
||||||
|
titleHeading={false}
|
||||||
description={emptyCardData.description}
|
description={emptyCardData.description}
|
||||||
icon={<LuFolderCheck className="size-16" />}
|
icon={<LuFolderCheck className="size-16" />}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user