2020-09-02 03:10:28 +03:00
|
|
|
import * as React from "react";
|
|
|
|
|
2020-11-30 08:24:22 +03:00
|
|
|
import { css } from "@emotion/react";
|
2020-09-02 03:10:28 +03:00
|
|
|
|
2021-11-04 18:51:57 +03:00
|
|
|
const STYLES_EMPTY_STATE = (theme) => css`
|
|
|
|
position: relative;
|
2020-09-02 03:10:28 +03:00
|
|
|
width: 100%;
|
2021-12-11 00:26:41 +03:00
|
|
|
height: 100%;
|
|
|
|
min-height: 50vh;
|
2021-11-04 18:51:57 +03:00
|
|
|
color: ${theme.semantic.textGray};
|
|
|
|
background-color: ${theme.semantic.bgLight};
|
2020-09-14 08:22:19 +03:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-direction: column;
|
2020-09-14 23:42:52 +03:00
|
|
|
text-align: center;
|
2020-10-08 06:08:55 +03:00
|
|
|
margin-top: 48px;
|
2020-09-02 03:10:28 +03:00
|
|
|
`;
|
|
|
|
|
2021-11-04 18:51:57 +03:00
|
|
|
const STYLES_EMPTY_FRAME = (theme) => css`
|
|
|
|
position: absolute;
|
|
|
|
height: 14px;
|
|
|
|
width: 14px;
|
|
|
|
border-left: 2px solid;
|
|
|
|
border-top: 2px solid;
|
|
|
|
border-color: ${theme.semantic.borderGrayLight4};
|
2021-11-19 22:28:25 +03:00
|
|
|
|
|
|
|
@media (max-width: ${theme.sizes.mobile}px) {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-11-04 18:51:57 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
export default function EmptyState({ children, css, ...props }) {
|
|
|
|
return (
|
|
|
|
<div css={[STYLES_EMPTY_STATE, css]} {...props}>
|
|
|
|
<div css={STYLES_EMPTY_FRAME} style={{ top: 12, left: 12 }} />
|
|
|
|
<div css={STYLES_EMPTY_FRAME} style={{ top: 12, right: 12, transform: "rotate(90deg)" }} />
|
|
|
|
<div css={STYLES_EMPTY_FRAME} style={{ bottom: 12, left: 12, transform: "rotate(270deg)" }} />
|
|
|
|
<div
|
|
|
|
css={STYLES_EMPTY_FRAME}
|
|
|
|
style={{ bottom: 12, right: 12, transform: "rotate(180deg)" }}
|
|
|
|
/>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
2020-09-02 03:10:28 +03:00
|
|
|
}
|