mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-06 20:11:15 +03:00
add optional onClick to EmptyCard
This commit is contained in:
parent
1f154a0205
commit
4da33493cd
@ -12,6 +12,7 @@ type EmptyCardProps = {
|
|||||||
description?: string;
|
description?: string;
|
||||||
buttonText?: string;
|
buttonText?: string;
|
||||||
link?: string;
|
link?: string;
|
||||||
|
onClick?: () => void;
|
||||||
};
|
};
|
||||||
export function EmptyCard({
|
export function EmptyCard({
|
||||||
className,
|
className,
|
||||||
@ -21,6 +22,7 @@ export function EmptyCard({
|
|||||||
description,
|
description,
|
||||||
buttonText,
|
buttonText,
|
||||||
link,
|
link,
|
||||||
|
onClick,
|
||||||
}: EmptyCardProps) {
|
}: EmptyCardProps) {
|
||||||
let TitleComponent;
|
let TitleComponent;
|
||||||
|
|
||||||
@ -39,11 +41,16 @@ export function EmptyCard({
|
|||||||
{description}
|
{description}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{buttonText?.length && (
|
{buttonText?.length &&
|
||||||
<Button size="sm" variant="select">
|
(onClick ? (
|
||||||
<Link to={link ?? "#"}>{buttonText}</Link>
|
<Button size="sm" variant="select" onClick={onClick}>
|
||||||
</Button>
|
{buttonText}
|
||||||
)}
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button size="sm" variant="select">
|
||||||
|
<Link to={link ?? "#"}>{buttonText}</Link>
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user