2023-07-11 19:54:57 +00:00
|
|
|
import { theme } from '../stitches.config';
|
2023-06-06 01:31:16 +00:00
|
|
|
|
|
|
|
|
export enum NoDataType {
|
2023-06-06 16:53:13 +00:00
|
|
|
BattlesInPeriod,
|
|
|
|
|
PlayersInPeriod,
|
|
|
|
|
TanksFound,
|
2023-06-06 01:31:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface NoDataProps {
|
|
|
|
|
type: NoDataType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const NO_DATA_MESSAGES: Record<NoDataType, string> = {
|
2023-06-06 16:53:13 +00:00
|
|
|
[NoDataType.BattlesInPeriod]: 'No battles played in this period',
|
|
|
|
|
[NoDataType.PlayersInPeriod]: 'No players in this period',
|
|
|
|
|
[NoDataType.TanksFound]: 'No tanks found',
|
2023-06-06 01:31:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default function NoData({ type }: NoDataProps) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<span style={{ fontSize: 16, color: theme.colors.textLowContrast }}>
|
|
|
|
|
{NO_DATA_MESSAGES[type]}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|