-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.tsx
More file actions
81 lines (73 loc) · 1.96 KB
/
index.tsx
File metadata and controls
81 lines (73 loc) · 1.96 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 { color, Flex, Typography } from '@sipe-team/side';
import clsx from 'clsx';
import Badge from '@/components/atoms/Badge';
import GlowArea from '@/components/molecules/GlowArea';
import { CheckCircleIcon } from '@/libs/assets/icons';
import styles from './index.module.scss';
interface TableProps {
isApplicant: boolean;
dataList: DataListProps[];
}
interface TableDataProps {
isApplicant: boolean;
data: TableProps['dataList'][number];
}
interface DataListProps {
recurring_date?: string;
text: string;
badge?: string | undefined;
highlight?: boolean | undefined;
}
function Table({ dataList, isApplicant }: TableProps) {
return (
<Flex
align="center"
className={styles.wrapper}
direction="column"
inline={true}
gap="32px"
justify="center"
>
{dataList.map((data, index) =>
data.highlight ? (
<GlowArea key={index} rx={12}>
<TableData isApplicant={isApplicant} data={data} />
</GlowArea>
) : (
<TableData key={index} isApplicant={isApplicant} data={data} />
),
)}
</Flex>
);
}
function TableData({ data, isApplicant }: TableDataProps) {
return (
<Flex
align="center"
className={clsx(styles.table, { [styles.isApplicant]: isApplicant })}
direction="row"
gap="20px"
inline={true}
justify="space-between"
>
{isApplicant ? (
// 이전 check_circle.svg 색상은: --cyan 이었음
<CheckCircleIcon style={{ color: 'var(--primary)' }} />
) : (
<Typography color={'var(--gray700)'} size={14}>
{data.recurring_date}
</Typography>
)}
<Typography
color={color.white}
className={clsx(styles.text, { [styles.isApplicant]: isApplicant })}
size={20}
weight="bold"
>
{data.text}
</Typography>
{!isApplicant && data.badge && <Badge text={data.badge} />}
</Flex>
);
}
export default Table;