mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-03 09:13:22 +00:00
35 lines
955 B
TypeScript
35 lines
955 B
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" color="text.secondary" className="max-w-sm">
|
||
|
|
{description}
|
||
|
|
</Typography>
|
||
|
|
)}
|
||
|
|
{action && <Box className="mt-2">{action}</Box>}
|
||
|
|
</Box>
|
||
|
|
);
|
||
|
|
}
|