1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

move graphic cards to left sidebar

This commit is contained in:
Fedor Katurov 2023-10-26 12:25:08 +06:00
parent 70332cb035
commit a2a60aee8e
8 changed files with 74 additions and 49 deletions

View file

@ -1,5 +1,6 @@
import React, { FC } from 'react';
import { FC, useMemo } from 'react';
import { BorisGraphicStats } from '~/components/boris/BorisGraphicStats';
import { StatsRow } from '~/components/common/StatsRow';
import { SubTitle } from '~/components/common/SubTitle';
import { StatBackend } from '~/types/boris';
@ -13,6 +14,15 @@ interface IProps {
}
const BorisStatsBackend: FC<IProps> = ({ isLoading, stats }) => {
const commentsByMonth = useMemo(
() => stats.comments.by_month?.slice(0, -1),
[stats.comments.by_month],
);
const nodesByMonth = useMemo(
() => stats.nodes.by_month?.slice(0, -1),
[stats.comments.by_month],
);
if (!stats && !isLoading) {
return null;
}
@ -54,11 +64,22 @@ const BorisStatsBackend: FC<IProps> = ({ isLoading, stats }) => {
{stats.nodes.audios}
</StatsRow>
<StatsRow isLoading={isLoading} label="Комментарии">
{stats.comments.total}
</StatsRow>
{/*
<StatsRow isLoading={isLoading} label="Комментарии">
{stats.comments.total}
</StatsRow>
*/}
</ul>
<div className={styles.graphs}>
<BorisGraphicStats
totalComments={stats.comments.total}
commentsByMonth={commentsByMonth}
totalNodes={stats.nodes.total}
nodesByMonth={nodesByMonth}
/>
</div>
<SubTitle isLoading={isLoading} className={styles.title}>
Сторедж
</SubTitle>