mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +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;
|
||||
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>
|
||||
)}
|
||||
|
||||
@ -762,8 +762,9 @@ function DetectionReview({
|
||||
|
||||
{!loading && currentItems?.length === 0 && (
|
||||
<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}
|
||||
titleHeading={false}
|
||||
description={emptyCardData.description}
|
||||
icon={<LuFolderCheck className="size-16" />}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user