shoc-frontend-new/src/components/ui/empty-state.tsx
2026-07-13 03:10:41 -03:00

40 lines
1 KiB
TypeScript

import type { ReactNode } from "react";
import { Box, Typography } from "@mui/material";
import { cn } from "@/lib/utils";
type EmptyStateProps = {
icon?: ReactNode;
title: string;
description?: string;
action?: ReactNode;
className?: string;
};
export function EmptyState({ icon, title, description, action, className }: EmptyStateProps) {
return (
<Box
className={cn(
"flex flex-col items-center justify-center gap-3 rounded-lg border border-border bg-card px-6 py-12 text-center",
className,
)}
>
{icon && <Box className="text-muted-foreground">{icon}</Box>}
<Typography variant="subtitle1" className="text-foreground">
{title}
</Typography>
{description && (
<Typography
variant="body2"
className="max-w-sm"
sx={{
color: "text.secondary",
}}
>
{description}
</Typography>
)}
{action && <Box className="mt-2">{action}</Box>}
</Box>
);
}