noogle/website/components/emptyRecordsPlaceholder/emptyRecordsPlaceholder.tsx
Johannes Kirschbauer d9f579cf44
Feature/monorepo (#24)
* refactor to include all necessary dependencies directly here

* move indexer into monorepo

* add snapshot tests and seperate sub.project for builtin types

* add more missing builtins such as fromTOML
2023-02-25 13:14:40 +01:00

62 lines
1.4 KiB
TypeScript

import { Card, CardContent, CardProps, Typography } from "@mui/material";
import InboxIcon from "@mui/icons-material/Inbox";
interface EmptyRecordsPlaceholderProps {
title: string;
subtitle?: string;
icon?: React.ReactNode;
CardProps?: CardProps;
}
export const EmptyRecordsPlaceholder = (
props: EmptyRecordsPlaceholderProps
) => {
const { title, subtitle, icon, CardProps = {} } = props;
return (
<Card
elevation={0}
sx={{
pt: 4,
my: 3,
width: "100%",
border: "none",
}}
{...CardProps}
>
<CardContent
sx={{
backgroundColor: "inherit",
display: "flex",
justifyContent: "center",
alignItems: "center",
flexDirection: "column",
height: "100%",
}}
>
<Typography variant="h2" component="div">
{icon || (
<InboxIcon fontSize={"inherit"} sx={{ color: "text.secondary" }} />
)}
</Typography>
<Typography
variant={"subtitle1"}
color="text.secondary"
aria-label={"placeholder-title"}
>
{title}
</Typography>
<Typography
variant={"subtitle2"}
color="text.secondary"
aria-label={"placeholder-subtitle"}
>
{subtitle}
</Typography>
</CardContent>
</Card>
);
};