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/components/boris/BorisStatsGit/index.tsx
2020-11-18 12:45:48 +07:00

48 lines
1.2 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 React, { FC } from 'react';
import { IBorisState } from '~/redux/boris/reducer';
import styles from './styles.module.scss';
import { Placeholder } from '~/components/placeholders/Placeholder';
import { BorisStatsGitCard } from '../BorisStatsGitCard';
interface IProps {
stats: IBorisState['stats'];
}
const BorisStatsGit: FC<IProps> = ({ stats }) => {
if (!stats.git.length) return null;
if (stats.is_loading) {
return (
<>
<div className={styles.stats__title}>
<Placeholder width="50%" />
</div>
<Placeholder width="50%" />
<Placeholder width="100%" />
<Placeholder width="50%" />
<Placeholder width="70%" />
<Placeholder width="60%" />
<Placeholder width="100%" />
</>
);
}
return (
<div className={styles.wrap}>
<div className={styles.stats__title}>
<span>КОММИТС</span>
<img src="https://jenkins.vault48.org/api/badges/muerwre/vault-golang/status.svg" />
</div>
{stats.git
.filter(data => data.commit && data.timestamp && data.subject)
.slice(0, 5)
.map(data => (
<BorisStatsGitCard data={data} key={data.commit} />
))}
</div>
);
};
export { BorisStatsGit };