1
1
import Box from "@mui/material/Box" ;
2
2
import Chip from "@mui/material/Chip" ;
3
- import { makeStyles } from "@mui/styles" ;
4
3
import Typography from "@mui/material/Typography" ;
4
+ import { type FC , type ReactNode } from "react" ;
5
+ import { type Interpolation , type Theme } from "@emotion/react" ;
5
6
import { Stack } from "components/Stack/Stack" ;
6
- import { FC , ReactNode } from "react" ;
7
7
8
8
export interface PaywallProps {
9
9
message :string ;
@@ -13,17 +13,16 @@ export interface PaywallProps {
13
13
14
14
export const Paywall :FC < React . PropsWithChildren < PaywallProps > > = ( props ) => {
15
15
const { message, description, cta} = props ;
16
- const styles = useStyles ( ) ;
17
16
18
17
return (
19
- < Box className = { styles . root } >
20
- < div className = { styles . header } >
18
+ < Box css = { styles . root } >
19
+ < div css = { styles . header } >
21
20
< Stack direction = "row" alignItems = "center" justifyContent = "center" >
22
- < Typography variant = "h5" className = { styles . title } >
21
+ < Typography variant = "h5" css = { styles . title } >
23
22
{ message }
24
23
</ Typography >
25
24
< Chip
26
- className = { styles . enterpriseChip }
25
+ css = { styles . enterpriseChip }
27
26
label = "Enterprise"
28
27
size = "small"
29
28
color = "primary"
@@ -34,7 +33,7 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
34
33
< Typography
35
34
variant = "body2"
36
35
color = "textSecondary"
37
- className = { styles . description }
36
+ css = { styles . description }
38
37
>
39
38
{ description }
40
39
</ Typography >
@@ -45,8 +44,8 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
45
44
) ;
46
45
} ;
47
46
48
- const useStyles = makeStyles ( ( theme ) => ( {
49
- root :{
47
+ const styles = {
48
+ root :( theme ) => ( {
50
49
display :"flex" ,
51
50
flexDirection :"column" ,
52
51
justifyContent :"center" ,
@@ -57,24 +56,24 @@ const useStyles = makeStyles((theme) => ({
57
56
backgroundColor :theme . palette . background . paper ,
58
57
border :`1px solid${ theme . palette . divider } ` ,
59
58
borderRadius :theme . shape . borderRadius ,
60
- } ,
61
- header :{
59
+ } ) ,
60
+ header :( theme ) => ( {
62
61
marginBottom :theme . spacing ( 3 ) ,
63
- } ,
62
+ } ) ,
64
63
title :{
65
64
fontWeight :600 ,
66
65
fontFamily :"inherit" ,
67
66
} ,
68
- description :{
67
+ description :( theme ) => ( {
69
68
marginTop :theme . spacing ( 1 ) ,
70
69
fontFamily :"inherit" ,
71
70
maxWidth :420 ,
72
71
lineHeight :"160%" ,
73
- } ,
74
- enterpriseChip :{
72
+ } ) ,
73
+ enterpriseChip :( theme ) => ( {
75
74
background :theme . palette . success . dark ,
76
75
color :theme . palette . success . contrastText ,
77
76
border :`1px solid${ theme . palette . success . light } ` ,
78
77
fontSize :13 ,
79
- } ,
80
- } ) ) ;
78
+ } ) ,
79
+ } satisfies Record < string , Interpolation < Theme > > ;