Frontend security / security (push) Successful in 9s
Frontend verify / verify (push) Successful in 5m10s
Conventional commits / commits (pull_request) Successful in 25s
Frontend security / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 5m10s
27 lines
603 B
TypeScript
27 lines
603 B
TypeScript
import { Paper, Stack, Text, Title } from "@mantine/core";
|
|
import type { FC, ReactNode } from "react";
|
|
|
|
type StateViewProps = {
|
|
title: string;
|
|
text: string;
|
|
action?: ReactNode;
|
|
error?: boolean;
|
|
};
|
|
|
|
const StateView: FC<StateViewProps> = (props) => {
|
|
const { title, text, action, error = false } = props;
|
|
const role = error ? "alert" : undefined;
|
|
|
|
return (
|
|
<Paper p="xl" radius="md" shadow="xs" withBorder role={role}>
|
|
<Stack align="flex-start" gap="sm">
|
|
<Title order={2}>{title}</Title>
|
|
<Text c="dimmed">{text}</Text>
|
|
{action}
|
|
</Stack>
|
|
</Paper>
|
|
);
|
|
};
|
|
|
|
export { StateView };
|