mirror of
https://github.com/Noooste/garage-ui.git
synced 2026-08-11 14:06:53 +00:00
bfed48421b
Signed-off-by: Noooste <83548733+Noooste@users.noreply.github.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import * as React from 'react';
|
|
import { IconTile } from './icon-tile';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
icon: React.ReactNode;
|
|
title: string;
|
|
description?: string;
|
|
action?: React.ReactNode;
|
|
tone?: 'primary' | 'neutral' | 'destructive';
|
|
}
|
|
|
|
export function EmptyState({ icon, title, description, action, tone = 'primary', className, ...props }: EmptyStateProps) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
'flex flex-col items-center justify-center gap-3 rounded-xl border border-[var(--border)] bg-[var(--card)] px-6 py-12 text-center',
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
<IconTile icon={icon} tone={tone} size="lg" />
|
|
<div className="space-y-1">
|
|
<h3 className="text-[17px] font-semibold tracking-tight">{title}</h3>
|
|
{description && (
|
|
<p className="max-w-sm text-[13.5px] text-[var(--muted-foreground)]">{description}</p>
|
|
)}
|
|
</div>
|
|
{action && <div className="pt-1">{action}</div>}
|
|
</div>
|
|
);
|
|
}
|