/
ProFeatureTooltip.tsx
48 lines (42 loc) · 1.37 KB
/
ProFeatureTooltip.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
import { ReactComponent as ProPlanIcon } from 'assets/icons/pro-enterprise-feature-badge.svg';
import { Box, Link, styled, Typography } from '@mui/material';
export interface ProFeatureTooltipProps {
children: React.ReactNode;
}
const ProFeatureTooltipWrapper = styled(Box)(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
padding: theme.spacing(1, 0.5),
}));
const StyledTitle = styled(Typography)(({ theme }) => ({
display: 'inline-flex',
alignItems: 'center',
fontWeight: theme.fontWeight.bold,
fontSize: theme.fontSizes.smallBody,
gap: theme.spacing(1),
}));
const StyledBody = styled(Typography)(({ theme }) => ({
fontSize: theme.fontSizes.smallBody,
margin: theme.spacing(1, 0),
}));
const StyledLink = styled(Link)(({ theme }) => ({
fontSize: theme.fontSizes.smallBody,
width: 'fit-content',
}));
export const ProFeatureTooltip = ({ children }: ProFeatureTooltipProps) => {
return (
<ProFeatureTooltipWrapper>
<StyledTitle>
<ProPlanIcon />
Pro & Enterprise feature
</StyledTitle>
<StyledBody>{children}</StyledBody>
<StyledLink
href={'https://www.getunleash.io/plans'}
target="_blank"
>
Upgrade now
</StyledLink>
</ProFeatureTooltipWrapper>
);
};