1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/containers/lab/LabStats/index.tsx
2023-11-21 19:10:57 +06:00

64 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { FC } from 'react';
import { Group } from '~/components/common/Group';
import { NodeHorizontalCard } from '~/components/common/NodeHorizontalCard';
import { SubTitle } from '~/components/common/SubTitle';
import { LabFactoryBanner } from '~/components/lab/LabFactoryBanner';
import { LabHeroes } from '~/components/lab/LabHeroes';
import { LabTags } from '~/components/lab/LabTags';
import { useLabContext } from '~/utils/context/LabContextProvider';
import styles from './styles.module.scss';
interface IProps {}
const LabStats: FC<IProps> = () => {
const { isLoadingStats, tags, heroes, updates } = useLabContext();
return (
<Group>
<LabFactoryBanner />
<div className={styles.card}>
<Group>
{(!!tags.length || isLoadingStats) && (
<SubTitle isLoading={isLoadingStats} className={styles.title}>
Тэги
</SubTitle>
)}
<div className={styles.tags}>
<LabTags tags={tags} isLoading={isLoadingStats} />
</div>
<div />
<div />
<div />
{updates.length > 0 && (
<>
<div className={styles.title}>Новые</div>
<Group className={styles.updates}>
{updates.slice(0, 10).map((node) => (
<NodeHorizontalCard node={node} key={node.id} hasNew />
))}
</Group>
</>
)}
{(!!heroes.length || isLoadingStats) && (
<SubTitle isLoading={isLoadingStats} className={styles.title}>
Важные
</SubTitle>
)}
<div className={styles.heroes}>
<LabHeroes nodes={heroes} isLoading={isLoadingStats} />
</div>
</Group>
</div>
</Group>
);
};
export { LabStats };