Initial state for GitNexus analysis
This commit is contained in:
39
apps/web/components/empty-state.tsx
Normal file
39
apps/web/components/empty-state.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Button } from '@kit/ui/button';
|
||||
|
||||
interface EmptyStateProps {
|
||||
icon?: React.ReactNode;
|
||||
title: string;
|
||||
description: string;
|
||||
actionLabel?: string;
|
||||
actionHref?: string;
|
||||
onAction?: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reusable empty state with icon + CTA.
|
||||
* Used when DataTables have 0 rows.
|
||||
*/
|
||||
export function EmptyState({ icon, title, description, actionLabel, actionHref, onAction }: EmptyStateProps) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center">
|
||||
{icon && (
|
||||
<div className="mb-4 rounded-full bg-muted p-4 text-muted-foreground">
|
||||
{icon}
|
||||
</div>
|
||||
)}
|
||||
<h3 className="text-lg font-semibold">{title}</h3>
|
||||
<p className="mt-1 max-w-sm text-sm text-muted-foreground">{description}</p>
|
||||
{actionLabel && (
|
||||
<div className="mt-6">
|
||||
{actionHref ? (
|
||||
<a href={actionHref}>
|
||||
<Button>{actionLabel}</Button>
|
||||
</a>
|
||||
) : (
|
||||
<Button onClick={onAction}>{actionLabel}</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user