-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathBriefCardLoading.tsx
More file actions
81 lines (78 loc) · 2.08 KB
/
BriefCardLoading.tsx
File metadata and controls
81 lines (78 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React, { Children } from 'react';
import classNames from 'classnames';
import type { ReactElement } from 'react';
import { LottieAnimation } from '../../../LottieAnimation';
import {
Typography,
TypographyColor,
TypographyType,
} from '../../../typography/Typography';
import { ProgressBar } from '../../../fields/ProgressBar';
import { briefCardBg, briefCardBorder } from '../../../../styles/custom';
import type { BriefCardProps } from './BriefCard';
export type BriefCardLoadingProps = BriefCardProps;
const rootStyle = {
border: briefCardBorder,
background: briefCardBg,
};
export const BriefCardLoading = ({
className,
animationSrc,
progressPercentage,
headnote,
title,
children,
}: BriefCardLoadingProps): ReactElement => {
return (
<div
style={rootStyle}
className={classNames(
'flex flex-1 flex-col items-center gap-4 rounded-16 p-4 text-center',
'backdrop-blur-3xl',
className?.card,
)}
>
<LottieAnimation
className="float-animation -mb-6 h-20 w-20"
src={animationSrc ?? ''}
/>
<div className="w-20">
<ProgressBar
shouldShowBg
percentage={progressPercentage ?? 0}
className={{
wrapper: 'rounded-12 bg-border-subtlest-tertiary',
bar: 'h-1',
barColor: 'bg-accent-blueCheese-default',
}}
/>
</div>
<Typography
type={TypographyType.Footnote}
color={TypographyColor.Tertiary}
>
{headnote}
</Typography>
<Typography
type={TypographyType.Title3}
color={TypographyColor.Primary}
bold
>
{title}
</Typography>
<div className="flex flex-col gap-2">
{Children.map(children, (child, index) => {
return (
<Typography
className={classNames(index !== 0 && 'opacity-32')}
type={TypographyType.Body}
color={TypographyColor.Primary}
>
{child}
</Typography>
);
})}
</div>
</div>
);
};