feat(mui): kit primitives — PageHeader, EmptyState, LoadingState, FilterBar, StatCard + DataTable onRowClick/rowDanger

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-06 23:18:39 +02:00
parent 26f12b01a0
commit ba18cb07f0
9 changed files with 450 additions and 3 deletions

View File

@@ -0,0 +1,52 @@
import type { ReactNode } from "react";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
export interface EmptyStateProps {
icon?: ReactNode;
title: string;
description?: string;
action?: ReactNode;
}
/** Centered empty-state placeholder: icon, title, description, optional CTA. */
export default function EmptyState({
icon,
title,
description,
action,
}: EmptyStateProps) {
return (
<Box
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
textAlign: "center",
py: 6,
color: "text.secondary",
gap: 1,
}}
>
{icon && (
<Box
sx={{ color: "text.disabled", mb: 0.5, fontSize: 48, lineHeight: 1 }}
>
{icon}
</Box>
)}
<Typography
variant="subtitle1"
sx={{ fontWeight: 500, color: "text.secondary" }}
>
{title}
</Typography>
{description && (
<Typography variant="body2" color="text.secondary">
{description}
</Typography>
)}
{action && <Box sx={{ mt: 1.5 }}>{action}</Box>}
</Box>
);
}