-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApplicantStatusButton.tsx
More file actions
52 lines (46 loc) ยท 1.37 KB
/
ApplicantStatusButton.tsx
File metadata and controls
52 lines (46 loc) ยท 1.37 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
import styled from '@emotion/styled';
import type { StatusLabel, ApplicationStatus } from '@/pages/admin/Dashboard/types/dashboard';
type Props = {
label: StatusLabel;
value: ApplicationStatus;
selected: boolean;
onClick: (status: ApplicationStatus) => void;
};
export const ApplicantStatusButton = ({ label, value, selected, onClick }: Props) => {
return (
<Wrapper label={label} selected={selected} onClick={() => onClick(value)}>
{label}
</Wrapper>
);
};
const Wrapper = styled.button<Pick<Props, 'selected' | 'label'>>(({ theme, selected, label }) => {
const statusStyles = {
ํฉ๊ฒฉ: {
backgroundColor: theme.colors.primary100,
color: theme.colors.primary800,
},
๋ถํฉ๊ฒฉ: {
backgroundColor: theme.colors.red100,
color: theme.colors.red600,
},
๋ฏธ์ : {
backgroundColor: theme.colors.gray100,
color: theme.colors.gray600,
},
};
const defaultStyle = {
backgroundColor: theme.colors.gray100,
color: theme.colors.gray600,
};
const appliedStyle = selected ? statusStyles[label] : defaultStyle;
return {
border: 'none',
padding: '0.4rem 1.7rem',
cursor: 'pointer',
fontSize: theme.font.size.sm,
fontWeight: selected ? theme.font.weight.bold : theme.font.weight.regular,
transition: 'all 200ms ease-in-out',
borderRadius: '4rem',
...appliedStyle,
};
});