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