frigate/web/src/components/card/EmptyCard.tsx

33 lines
747 B
TypeScript
Raw Normal View History

import React from "react";
import { Button } from "../ui/button";
import Heading from "../ui/heading";
2025-10-20 16:03:22 +03:00
import { Link } from "react-router-dom";
type EmptyCardProps = {
icon: React.ReactNode;
title: string;
description: string;
buttonText?: string;
2025-10-20 16:03:22 +03:00
link?: string;
};
export function EmptyCard({
icon,
title,
description,
buttonText,
2025-10-20 16:03:22 +03:00
link,
}: EmptyCardProps) {
return (
<div className="flex flex-col items-center gap-2">
{icon}
<Heading as="h4">{title}</Heading>
2025-10-20 16:03:22 +03:00
<div className="mb-3 text-secondary-foreground">{description}</div>
{buttonText?.length && (
<Button size="sm" variant="select">
2025-10-20 16:03:22 +03:00
<Link to={link ?? "#"}>{buttonText}</Link>
</Button>
)}
</div>
);
}