-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathVerdictBanner.tsx
58 lines (47 loc) · 1.25 KB
/
VerdictBanner.tsx
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
import React from "react";
import styled from "styled-components";
import ClosedCaseIcon from "svgs/icons/check-circle-outline.svg";
import HourglassIcon from "svgs/icons/hourglass.svg";
const BannerContainer = styled.div`
display: flex;
gap: 8px;
align-items: center;
svg {
width: 16px;
height: 16px;
}
`;
const VerdictTag = styled.small<{ ruled: boolean }>`
font-weight: 400;
line-height: 19px;
color: ${({ theme, ruled }) => (ruled ? theme.success : theme.primaryText)};
`;
const StyledHourglassIcon = styled(HourglassIcon)`
fill: ${({ theme }) => theme.primaryText};
`;
interface IVerdictIcon {
ruled: boolean;
}
const VerdictIcon: React.FC<IVerdictIcon> = ({ ruled }) => {
return ruled ? <ClosedCaseIcon /> : <StyledHourglassIcon />;
};
interface IVerdictText {
ruled: boolean;
}
const VerdictText: React.FC<IVerdictText> = ({ ruled }) => {
return ruled ? <>Case closed</> : <>Case ongoing</>;
};
interface IVerdictBanner {
ruled: boolean;
}
const VerdictBanner: React.FC<IVerdictBanner> = ({ ruled }) => {
return (
<BannerContainer>
<VerdictIcon ruled={ruled} />
<VerdictTag ruled={ruled}>
<VerdictText ruled={ruled} />
</VerdictTag>
</BannerContainer>
);
};
export default VerdictBanner;