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/common/StatsRow/index.tsx
2021-10-04 14:34:15 +07:00

21 lines
655 B
TypeScript

import React, { FC } from 'react';
import { Placeholder } from '~/components/placeholders/Placeholder';
import styles from './styles.module.scss';
const StatsRow: FC<{ isLoading: boolean; label: string }> = ({ isLoading, label, children }) => (
<li className={styles.row}>
{isLoading ? (
<>
<Placeholder active={isLoading} loading className={styles.label} />
<Placeholder active={isLoading} loading className={styles.value} width="24px" />
</>
) : (
<>
<div className={styles.label}>{label}</div>
<div className={styles.value}>{children}</div>
</>
)}
</li>
);
export { StatsRow };